From 0808043fddd5055e801f8cadb620cda188f761ca Mon Sep 17 00:00:00 2001 From: William Banfield Date: Fri, 20 May 2022 15:35:40 -0400 Subject: [PATCH] if/else fiddling --- internal/blocksync/reactor.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/blocksync/reactor.go b/internal/blocksync/reactor.go index 2361dc90b..6c1c060e7 100644 --- a/internal/blocksync/reactor.go +++ b/internal/blocksync/reactor.go @@ -549,19 +549,19 @@ func (r *Reactor) poolRoutine(ctx context.Context, stateSynced bool, blockSyncCh // see if there are any blocks to sync first, second, extCommit := r.pool.PeekTwoBlocks() - if state.ConsensusParams.ABCI.VoteExtensionsEnabled(state.LastBlockHeight+1) && - first != nil && extCommit == nil { + if first != nil && extCommit == nil && + state.ConsensusParams.ABCI.VoteExtensionsEnabled(first.Height) { // See https://github.com/tendermint/tendermint/pull/8433#discussion_r866790631 panic(fmt.Errorf("peeked first block without extended commit at height %d - possible node store corruption", first.Height)) } else if first == nil || second == nil { // we need to have fetched two consecutive blocks in order to // perform blocksync verification continue - } else { - // try again quickly next loop - didProcessCh <- struct{}{} } + // try again quickly next loop + didProcessCh <- struct{}{} + firstParts, err := first.MakePartSet(types.BlockPartSizeBytes) if err != nil { r.logger.Error("failed to make ",