native: deduce transferred assets from sender on transfer

When money is being sent usually they go away from someone's pocket, so that
there is a little less money left there. Not in our case as it turns out, we
actually were adding money both to sender and receiver which is nice, but a
bit different from usual economic's expectations.
This commit is contained in:
Roman Khimov 2020-05-27 22:51:44 +03:00
parent 2711b1b6fd
commit 7e586cc6ab

View file

@ -169,6 +169,8 @@ func (c *nep5TokenNative) transfer(ic *interop.Context, from, to util.Uint160, a
inc := amount
if isEmpty {
inc = big.NewInt(0)
} else {
inc = new(big.Int).Neg(inc)
}
if err := c.incBalance(ic, from, siFrom, inc); err != nil {
return err