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 {
|
if amount.Sign() == 0 {
|
||||||
return
|
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)
|
c.postTransfer(ic, &h, nil, amount, stackitem.Null{}, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue