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 62a11807a8
commit d1e02c393d

View file

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