Skip to content

Commit

Permalink
fix(p2p): update height in blocksync loop (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
srene authored Aug 28, 2024
1 parent f745143 commit 562f673
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 @@ -602,6 +602,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 562f673

Please sign in to comment.