forked from TrueCloudLab/neoneo-go
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:
parent
2711b1b6fd
commit
7e586cc6ab
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue