fix(wallet): Fixed missing loop for transfers loading.
Made channel for transfers loading buffered - non-blocking
This commit is contained in:
parent
ce45a7b1e8
commit
2f515447d2
|
@ -323,6 +323,7 @@ func loadTransfersLoop(ctx context.Context, account common.Address, blockDAO *Bl
|
|||
|
||||
log.Debug("loadTransfersLoop start", "chain", chainClient.ChainID, "account", account)
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
log.Info("loadTransfersLoop error", "chain", chainClient.ChainID, "account", account, "error", ctx.Err())
|
||||
|
@ -341,6 +342,7 @@ func loadTransfersLoop(ctx context.Context, account common.Address, blockDAO *Bl
|
|||
blocksByAddress, transactionManager, tokenManager, feed)
|
||||
}()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func newLoadBlocksAndTransfersCommand(account common.Address, db *Database,
|
||||
|
@ -357,7 +359,7 @@ func newLoadBlocksAndTransfersCommand(account common.Address, db *Database,
|
|||
errorsCount: 0,
|
||||
transactionManager: transactionManager,
|
||||
tokenManager: tokenManager,
|
||||
blocksLoadedCh: make(chan []*DBHeader),
|
||||
blocksLoadedCh: make(chan []*DBHeader, 100),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue