mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-02-20 01:01:54 +00:00
core: fix bug in nep5TokenNative.addTokens method
Sometimes we want to add negative amount (e.g. when burning tokens).
This commit is contained in:
parent
c7a040ff81
commit
6b2f4efdd4
1 changed files with 1 additions and 3 deletions
|
@ -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) {
|
func (c *nep5TokenNative) addTokens(ic *interop.Context, h util.Uint160, amount *big.Int) {
|
||||||
if sign := amount.Sign(); sign == -1 {
|
if amount.Sign() == 0 {
|
||||||
panic("negative amount")
|
|
||||||
} else if sign == 0 {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue