Fetch balances when db cache doesn't exist (#4710)
This commit is contained in:
parent
3ea2002904
commit
76d58ba7f0
|
@ -274,7 +274,13 @@ func (r *Reader) FetchOrGetCachedWalletBalances(ctx context.Context, addresses [
|
|||
return balances, nil
|
||||
}
|
||||
|
||||
return r.persistence.GetTokens()
|
||||
tokens, err := r.persistence.GetTokens()
|
||||
// there should be at least ETH balance
|
||||
if len(tokens) == 0 {
|
||||
return r.GetWalletTokenBalances(ctx, addresses)
|
||||
}
|
||||
|
||||
return tokens, err
|
||||
}
|
||||
|
||||
func (r *Reader) GetWalletTokenBalances(ctx context.Context, addresses []common.Address) (map[common.Address][]Token, error) {
|
||||
|
|
Loading…
Reference in New Issue