Skip to content

Commit

Permalink
Merge pull request #31 from bttcprotocol/fix/commit_state
Browse files Browse the repository at this point in the history
consensus: fix out of range bug
  • Loading branch information
zhang0125 authored Nov 25, 2022
2 parents 8eba5ac + 5a84c61 commit 2af757c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion consensus/bor/bor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,9 @@ func (c *Bor) CommitStates(
eventRecords, err := c.HeimdallClient.FetchStateSyncEvents(lastStateID+1, to.Unix())
if c.config.OverrideStateSyncRecords != nil {
if val, ok := c.config.OverrideStateSyncRecords[strconv.FormatUint(number, 10)]; ok {
eventRecords = eventRecords[0:val]
if val < len(eventRecords) {
eventRecords = eventRecords[0:val]
}
}
}

Expand Down

0 comments on commit 2af757c

Please sign in to comment.