Skip to content

Commit

Permalink
first merge with #8433
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalicevic committed May 11, 2022
1 parent 54418ab commit 32e06ad
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/blocksync/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type Reactor struct {
stateStore sm.Store

blockExec *sm.BlockExecutor
store sm.BlockStore
store store.BlockStore
pool *BlockPool
consReactor consensusReactor
blockSync *atomicBool
Expand Down Expand Up @@ -113,7 +113,7 @@ func NewReactor(
logger: logger,
stateStore: stateStore,
blockExec: blockExec,
store: store,
store: *store,
consReactor: consReactor,
blockSync: newAtomicBool(blockSync),
chCreator: channelCreator,
Expand Down Expand Up @@ -193,15 +193,15 @@ func (r *Reactor) respondToPeer(ctx context.Context, msg *bcproto.BlockRequest,
if extCommit == nil {
return fmt.Errorf("found block in store without extended commit: %v", block)
}
blockProto, err := block.ToProto()
if err != nil {
return fmt.Errorf("failed to convert block to protobuf: %w", err)
}
// blockProto, err := block.ToProto()
// if err != nil {
// return fmt.Errorf("failed to convert block to protobuf: %w", err)
// }

return blockSyncCh.Send(ctx, p2p.Envelope{
To: peerID,
Message: &bcproto.BlockResponse{
Block: blockProto,
Block: block,
ExtCommit: extCommit.ToProto(),
},
})
Expand Down Expand Up @@ -522,7 +522,7 @@ func (r *Reactor) poolRoutine(ctx context.Context, stateSynced bool, blockSyncCh
if newBlock == nil || verifyBlock == nil || extCommit == nil {
if newBlock != nil && extCommit == nil {
// 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))
panic(fmt.Errorf("peeked first block without extended commit at height %d - possible node store corruption", newBlock.Height))
}
// we need all to sync the first block

Expand Down

0 comments on commit 32e06ad

Please sign in to comment.