From e3dfb5d165510944cb381a3313a3e8a61614d6af Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Sun, 13 Dec 2020 21:04:10 +0300 Subject: [PATCH] cli/wallet: swap name/address checks for token identification Address identification must have a priority, another token can have this address in its name, but when there is a hash specified we should take the one with proper hash. --- cli/wallet/nep17.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/wallet/nep17.go b/cli/wallet/nep17.go index e988a0a30..80269f06e 100644 --- a/cli/wallet/nep17.go +++ b/cli/wallet/nep17.go @@ -228,7 +228,7 @@ func getMatchingTokenAux(ctx *cli.Context, get func(i int) *wallet.Token, n int, var count int for i := 0; i < n; i++ { t := get(i) - if t != nil && (t.Name == name || t.Symbol == name || t.Address() == name || t.Hash.StringLE() == name) { + if t != nil && (t.Hash.StringLE() == name || t.Address() == name || t.Symbol == name || t.Name == name) { if count == 1 { printTokenInfo(ctx, token) printTokenInfo(ctx, t)