From d1e02c393d733d001388f478c4ab27218d61c912 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 4 Feb 2021 18:48:09 +0300 Subject: [PATCH] consensus: only use previous proposal if it has something in it It might just be uninitialized it doesn't really make sense using zero-length previous proposal anyway. --- pkg/consensus/consensus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index cca8d060e..ad1aa8e3d 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -553,7 +553,7 @@ func (s *service) getVerifiedTx() []block.Transaction { var txx []mempool.TxWithFee - if s.dbft.ViewNumber > 0 { + if s.dbft.ViewNumber > 0 && len(s.lastProposal) > 0 { txx = make([]mempool.TxWithFee, 0, len(s.lastProposal)) for i := range s.lastProposal { if tx, fee, ok := pool.TryGetValue(s.lastProposal[i]); ok {