mirror of
https://github.com/tendermint/tendermint.git
synced 2026-10-01 12:15:45 +00:00
math: remove panics in safe math ops (#7962)
* math: remove panics in safe math ops * fix docs * fix lint
This commit is contained in:
@@ -504,8 +504,12 @@ func (store dbStore) LoadValidators(height int64) (*types.ValidatorSet, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
h, err := tmmath.SafeConvertInt32(height - lastStoredHeight)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
vs.IncrementProposerPriority(tmmath.SafeConvertInt32(height - lastStoredHeight)) // mutate
|
||||
vs.IncrementProposerPriority(h) // mutate
|
||||
vi2, err := vs.ToProto()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user