Skip to content

Commit

Permalink
Change heights range for generating balance during block processing.
Browse files Browse the repository at this point in the history
During block processing range for generating balance includes the
current applying block. When block is processed and applied to the state
the 'NewestFullWavesBalance' and 'WavesBalanceProfile' methods work as
the regular methods (when applying block is not included in the range).
  • Loading branch information
nickeskov committed Aug 24, 2024
1 parent 38d2422 commit e7c188e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,8 @@ func (s *stateManager) WavesBalanceProfile(id proto.AddressID) (*types.WavesBala
if err != nil {
return nil, wrapErr(RetrievalError, err)
}
height, err := s.NewestHeight()
// get the height of the applying block if it is in progress, or the last block height
height, err := s.AddingBlockHeight()
if err != nil {
return nil, wrapErr(RetrievalError, err)
}
Expand Down

0 comments on commit e7c188e

Please sign in to comment.