native: save balance value in storage for failed transfers
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
e3323faf69
commit
a7722f0fa5
1 changed files with 3 additions and 0 deletions
|
@ -195,6 +195,9 @@ func (c *nep17TokenNative) updateAccBalance(ic *interop.Context, acc util.Uint16
|
|||
|
||||
err := c.incBalance(ic, acc, &si, amount)
|
||||
if err != nil {
|
||||
if si != nil && amount.Sign() < 0 {
|
||||
_ = ic.DAO.PutStorageItem(c.ID, key, si)
|
||||
}
|
||||
return err
|
||||
}
|
||||
if si == nil {
|
||||
|
|
Loading…
Reference in a new issue