Merge pull request #3435 from JackyWYX/fbftlog_fix

[consensus] fix nil map in fbftlog in lastMileBlockIter
pull/3436/head
Rongjian Lan 4 years ago committed by GitHub
commit 586f847031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      consensus/consensus_v2.go

@ -400,7 +400,7 @@ func (consensus *Consensus) Start(
// All blocks returned are guaranteed to pass the verification. // All blocks returned are guaranteed to pass the verification.
type LastMileBlockIter struct { type LastMileBlockIter struct {
blockCandidates []*types.Block blockCandidates []*types.Block
fbftLog FBFTLog fbftLog *FBFTLog
verify func(*types.Block) error verify func(*types.Block) error
curIndex int curIndex int
logger *zerolog.Logger logger *zerolog.Logger
@ -420,6 +420,7 @@ func (consensus *Consensus) GetLastMileBlockIter(bnStart uint64) (*LastMileBlock
} }
return &LastMileBlockIter{ return &LastMileBlockIter{
blockCandidates: blocks, blockCandidates: blocks,
fbftLog: consensus.FBFTLog,
verify: consensus.BlockVerifier, verify: consensus.BlockVerifier,
curIndex: 0, curIndex: 0,
logger: consensus.getLogger(), logger: consensus.getLogger(),

Loading…
Cancel
Save