mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-26 09:54:19 +00:00
blocksync: fixed issues after merge
This commit is contained in:
@@ -690,7 +690,7 @@ OUTER_LOOP:
|
||||
}
|
||||
peer = wreq.pool.pickIncrAvailableWitness(wreq.height)
|
||||
if peer == nil {
|
||||
time.Sleep(requestIntervalMS * time.Millisecond)
|
||||
time.Sleep(requestInterval * time.Millisecond)
|
||||
continue PICK_PEER_LOOP
|
||||
}
|
||||
break PICK_PEER_LOOP
|
||||
|
||||
@@ -638,11 +638,11 @@ func (r *Reactor) poolRoutine(ctx context.Context, stateSynced bool, blockSyncCh
|
||||
}
|
||||
continue // was return previously
|
||||
}
|
||||
|
||||
}
|
||||
if err := r.verifyWithWitnesses(newBlock); err != nil {
|
||||
r.logger.Debug("Witness verificatio nfailed")
|
||||
r.lastTrustedBlock = &BlockResponse{}
|
||||
}
|
||||
// if err := r.verifyWithWitnesses(newBlock); err != nil {
|
||||
// r.logger.Debug("Witness verificatio nfailed")
|
||||
// }
|
||||
var err error
|
||||
// validate the block before we persist it
|
||||
err = r.blockExec.ValidateBlock(ctx, state, newBlock)
|
||||
@@ -678,6 +678,9 @@ func (r *Reactor) poolRoutine(ctx context.Context, stateSynced bool, blockSyncCh
|
||||
panic(fmt.Sprintf("failed to process committed block (%d:%X): %v", newBlock.Height, newBlock.Hash(), err))
|
||||
}
|
||||
|
||||
r.lastTrustedBlock.block = newBlock
|
||||
r.lastTrustedBlock.commit = r.store.LoadSeenCommit()
|
||||
|
||||
r.metrics.RecordConsMetrics(newBlock)
|
||||
|
||||
blocksSynced++
|
||||
|
||||
@@ -87,8 +87,10 @@ func VerifyNextBlock(newBlock *types.Block, newBlockID types.BlockID, verifyBloc
|
||||
|
||||
// If the blockID in LastCommit of NewBlock does not match the trusted block
|
||||
// we can assume NewBlock is not correct
|
||||
if !(newBlock.LastCommit.BlockID.Equals(trustedCommit.BlockID)) {
|
||||
return ErrBlockIDDiff{}
|
||||
if trustedCommit != nil {
|
||||
if !(newBlock.LastCommit.BlockID.Equals(trustedCommit.BlockID)) {
|
||||
return ErrBlockIDDiff{}
|
||||
}
|
||||
}
|
||||
|
||||
// Todo: Verify verifyBlock.LastCommit validators against state.NextValidators
|
||||
|
||||
Reference in New Issue
Block a user