From 8c0a7225e52dd2dabb353337909e2edeb9663e4b 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 1af47538d..12d8be085 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -580,7 +580,7 @@ func (s *service) getVerifiedTx() []block.Transaction { var txx []*transaction.Transaction - if s.dbft.ViewNumber > 0 { + if s.dbft.ViewNumber > 0 && len(s.lastProposal) > 0 { txx = make([]*transaction.Transaction, 0, len(s.lastProposal)) for i := range s.lastProposal { if tx, ok := pool.TryGetValue(s.lastProposal[i]); ok {