mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 19:29:39 +00:00
native: avoid big.Int allocation in burn()
addTokens and incBalance only read the amount, so it's not a problem.
This commit is contained in:
parent
a003879b84
commit
ac7e922606
1 changed files with 3 additions and 1 deletions
|
@ -262,7 +262,9 @@ func (c *nep17TokenNative) burn(ic *interop.Context, h util.Uint160, amount *big
|
|||
if amount.Sign() == 0 {
|
||||
return
|
||||
}
|
||||
c.addTokens(ic, h, new(big.Int).Neg(amount))
|
||||
amount.Neg(amount)
|
||||
c.addTokens(ic, h, amount)
|
||||
amount.Neg(amount)
|
||||
c.postTransfer(ic, &h, nil, amount, stackitem.Null{}, false)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue