forked from TrueCloudLab/neoneo-go
native: fix voting accounting in transfers processing
We should modify votes count exactly by the amount of NEO balance change, it might be negative here.
This commit is contained in:
parent
37d44b94e1
commit
5e56c9db29
1 changed files with 1 additions and 1 deletions
|
@ -162,7 +162,7 @@ func (n *NEO) increaseBalance(ic *interop.Context, h util.Uint160, si *state.Sto
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if len(acc.Votes) > 0 {
|
if len(acc.Votes) > 0 {
|
||||||
if err := n.ModifyAccountVotes(acc, ic.DAO, new(big.Int).Neg(&acc.Balance)); err != nil {
|
if err := n.ModifyAccountVotes(acc, ic.DAO, amount); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
siVC := ic.DAO.GetStorageItem(n.ContractID, validatorsCountKey)
|
siVC := ic.DAO.GetStorageItem(n.ContractID, validatorsCountKey)
|
||||||
|
|
Loading…
Reference in a new issue