fix additional use of extended commit

This commit is contained in:
William Banfield
2022-05-19 21:55:51 -04:00
parent d69cf82e3f
commit 6889f77807
+14 -7
View File
@@ -798,13 +798,20 @@ func (r *Reactor) gossipVotesRoutine(ctx context.Context, ps *PeerState, voteCh
if blockStoreBase > 0 && prs.Height != 0 && rs.Height >= prs.Height+2 && prs.Height >= blockStoreBase {
// Load the block's extended commit for prs.Height, which contains precommit
// signatures for prs.Height.
if ec := r.state.blockStore.LoadBlockExtendedCommit(prs.Height); ec != nil {
if ok, err := r.pickSendVote(ctx, ps, ec, voteCh); err != nil {
return
} else if ok {
logger.Debug("picked Catchup commit to send", "height", prs.Height)
continue
}
var ec *types.ExtendedCommit
if r.state.state.ConsensusParams.ABCI.VoteExtensionsEnabled(prs.Height) {
ec = r.state.blockStore.LoadBlockExtendedCommit(prs.Height)
} else {
ec = r.state.blockStore.LoadBlockCommit(prs.Height).WrappedExtendedCommit()
}
if ec == nil {
continue
}
if ok, err := r.pickSendVote(ctx, ps, ec, voteCh); err != nil {
return
} else if ok {
logger.Debug("picked Catchup commit to send", "height", prs.Height)
continue
}
}