Browse Source

Merge pull request #818 from tendermint/fix/810-stuck-trailing-node

consensus: ensure prs.ProposalBlockParts is initialized. fixes #810
pull/811/merge
Ethan Buchman 7 years ago
committed by GitHub
parent
commit
433416fef8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      consensus/reactor.go

+ 14
- 0
consensus/reactor.go View File

@ -499,6 +499,20 @@ OUTER_LOOP:
func (conR *ConsensusReactor) gossipDataForCatchup(logger log.Logger, rs *cstypes.RoundState,
prs *cstypes.PeerRoundState, ps *PeerState, peer p2p.Peer) {
// this might happen if we didn't receive the commit message from the peer
// NOTE: wouldn't it be better if the peer resubmitted his CommitStepMessage periodically if not progressing?
if prs.ProposalBlockParts == nil {
blockMeta := conR.conS.blockStore.LoadBlockMeta(prs.Height)
if blockMeta == nil {
logger.Error("Failed to load block meta",
"ourHeight", rs.Height, "blockstoreHeight", conR.conS.blockStore.Height())
time.Sleep(conR.conS.config.PeerGossipSleep())
return
}
prs.ProposalBlockPartsHeader = blockMeta.BlockID.PartsHeader
prs.ProposalBlockParts = cmn.NewBitArray(blockMeta.BlockID.PartsHeader.Total)
}
if index, ok := prs.ProposalBlockParts.Not().PickRandom(); ok {
// Ensure that the peer's PartSetHeader is correct
blockMeta := conR.conS.blockStore.LoadBlockMeta(prs.Height)


Loading…
Cancel
Save