Skip to content

Commit

Permalink
update height in blocksync loop
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Aug 22, 2024
1 parent 88ba1fe commit e8ebce6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p2p/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,11 @@ func (c *Client) retrieveBlockSyncLoop(ctx context.Context, msgHandler BlockSync

c.logger.Debug("Blocksync block received ", "height", h)
msgHandler(&block)
state, err := c.store.LoadState()
if err != nil {
return
}
h = max(h, state.NextHeight()-1)
}
c.blocksReceived.RemoveBlocksReceivedUpToHeight(state.NextHeight())
}
Expand Down

0 comments on commit e8ebce6

Please sign in to comment.