mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-05 03:58:23 +00:00
Merge pull request #945 from nspcc-dev/examples/nep5-transfer-bug
examples: Use "or" operator in transfer check of NEP5 token
This commit is contained in:
commit
c85e77e1c9
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
|
||||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue