Skip to content

Commit

Permalink
Merge pull request #127 from nspcc-dev/fix-preblock-reset
Browse files Browse the repository at this point in the history
context: properly reset preBlock and preHeader
  • Loading branch information
roman-khimov committed Aug 28, 2024
2 parents d01dbcb + 9be6f21 commit b129031
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Improvements:
* minimum required Go version is 1.22 (#122, #126)

Bugs fixed:
* context-bound PreBlock and PreHeader are not reset properly (#127)

## [0.3.0] (01 August 2024)

Expand Down
2 changes: 2 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ func (c *Context[H]) reset(view byte, ts uint64) {
c.MyIndex, c.Priv, c.Pub = c.Config.GetKeyPair(c.Validators)

c.block = nil
c.preBlock = nil
c.header = nil
c.preHeader = nil

n := len(c.Validators)
c.ChangeViewPayloads = emptyReusableSlice(c.ChangeViewPayloads, n)
Expand Down

0 comments on commit b129031

Please sign in to comment.