diff --git a/pkg/core/native/native_neo.go b/pkg/core/native/native_neo.go index 9e480e0ff..c77e679fe 100644 --- a/pkg/core/native/native_neo.go +++ b/pkg/core/native/native_neo.go @@ -158,14 +158,15 @@ func (n *NEO) increaseBalance(ic *interop.Context, h util.Uint160, si *state.Sto if err != nil { return err } - if sign := amount.Sign(); sign == 0 { - return nil - } else if sign == -1 && acc.Balance.Cmp(new(big.Int).Neg(amount)) == -1 { + if amount.Sign() == -1 && acc.Balance.Cmp(new(big.Int).Neg(amount)) == -1 { return errors.New("insufficient funds") } if err := n.distributeGas(ic, h, acc); err != nil { return err } + if amount.Sign() == 0 { + return nil + } acc.Balance.Add(&acc.Balance, amount) si.Value = acc.Bytes() return nil