core: fix bug in nep5TokenNative.addTokens method

Sometimes we want to add negative amount (e.g. when burning tokens).
This commit is contained in:
Anna Shaleva 2020-05-19 18:49:03 +03:00
parent c7a040ff81
commit 6b2f4efdd4

View file

@ -205,9 +205,7 @@ func (c *nep5TokenNative) burn(ic *interop.Context, h util.Uint160, amount *big.
}
func (c *nep5TokenNative) addTokens(ic *interop.Context, h util.Uint160, amount *big.Int) {
if sign := amount.Sign(); sign == -1 {
panic("negative amount")
} else if sign == 0 {
if amount.Sign() == 0 {
return
}