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:
Roman Khimov 2021-12-02 15:40:43 +03:00
parent a003879b84
commit ac7e922606

View file

@ -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)
}