mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 13:58:05 +00:00
Merge pull request #946 from nspcc-dev/examples/nep5-transfer-bug
examples: Use "or" operator in transfer check of NEP5 token
This commit is contained in:
commit
9eaec2adcd
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ func (t Token) Transfer(ctx storage.Context, from []byte, to []byte, amount int)
|
||||||
|
|
||||||
// CanTransfer returns the amount it can transfer
|
// CanTransfer returns the amount it can transfer
|
||||||
func (t Token) CanTransfer(ctx storage.Context, from []byte, to []byte, amount int) int {
|
func (t Token) CanTransfer(ctx storage.Context, from []byte, to []byte, amount int) int {
|
||||||
if len(to) != 20 && !IsUsableAddress(from) {
|
if len(to) != 20 || !IsUsableAddress(from) {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue