From d803dffca87d9e38ad145980c53679f6a9fda5a1 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 27 Dec 2019 13:52:07 +0300 Subject: [PATCH] consensus: return nil interface from getTx --- pkg/consensus/consensus.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index 39c7de9e2..8faf2c080 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -253,7 +253,13 @@ func (s *service) getTx(h util.Uint256) block.Transaction { tx, _, _ := s.Config.Chain.GetTransaction(h) - return tx + // this is needed because in case of absent tx dBFT expects to + // get nil interface, not a nil pointer to any concrete type + if tx != nil { + return tx + } + + return nil } func (s *service) verifyBlock(b block.Block) bool {