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.
This commit is contained in:
Roman Khimov 2021-02-04 18:48:09 +03:00
parent 07cabb1d00
commit 8c0a7225e5

View file

@ -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 {