diff --git a/VERSION b/VERSION index 70722afdb..a1cd603dc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.176.10 \ No newline at end of file +0.176.11 diff --git a/services/wallet/reader.go b/services/wallet/reader.go index 136283ff7..9ba4335ab 100644 --- a/services/wallet/reader.go +++ b/services/wallet/reader.go @@ -19,9 +19,8 @@ import ( "github.com/status-im/status-go/services/wallet/community" "github.com/status-im/status-go/services/wallet/market" "github.com/status-im/status-go/services/wallet/thirdparty" - "github.com/status-im/status-go/services/wallet/transfer" - "github.com/status-im/status-go/services/wallet/token" + "github.com/status-im/status-go/services/wallet/transfer" "github.com/status-im/status-go/services/wallet/walletevent" ) @@ -329,11 +328,28 @@ func (r *Reader) getWalletTokenBalances(ctx context.Context, addresses []common. cachedBalancesPerChain := map[common.Address]map[common.Address]map[uint64]string{} updateAnyway := false if !updateBalances { + cacheCheck: for _, address := range addresses { - if _, ok := cachedTokens[address]; !ok { + if res, ok := cachedTokens[address]; !ok || len(res) == 0 { updateAnyway = true break } + + networkFound := map[uint64]bool{} + for _, token := range cachedTokens[address] { + for _, chain := range chainIDs { + if _, ok := token.BalancesPerChain[chain]; ok { + networkFound[chain] = true + } + } + } + + for _, chain := range chainIDs { + if !networkFound[chain] { + updateAnyway = true + break cacheCheck + } + } } }