fix: reponse may contains less results than expected

This commit is contained in:
Anthony Laibe 2023-05-02 09:52:51 +02:00 committed by Anthony Laibe
parent e7fbc191f4
commit 722390c784
1 changed files with 6 additions and 0 deletions

View File

@ -705,7 +705,13 @@ func (tm *Manager) GetBalancesByChain(parent context.Context, clients map[uint64
return nil return nil
} }
if len(res) != len(chunk) {
log.Error("can't fetch erc20 token balance", "account", account, "error response not complete")
return nil
}
for idx, token := range chunk { for idx, token := range chunk {
if !res[idx].Success { if !res[idx].Success {
continue continue
} }