fix(wallet): new transfers were not loaded in real time

This commit is contained in:
Ivan Belyakov 2023-09-05 13:35:09 +02:00 committed by IvanBelyakoff
parent 24bf9aada5
commit 20c585a621
1 changed files with 2 additions and 2 deletions

View File

@ -45,14 +45,14 @@ func (c *findNewBlocksCommand) Run(parent context.Context) (err error) {
}
if blockRange != nil {
c.fromBlockNumber = new(big.Int).Add(blockRange.LastKnown, big.NewInt(1))
c.fromBlockNumber = blockRange.LastKnown
log.Debug("Launching new blocks command", "chainID", c.chainClient.ChainID, "account", c.account,
"from", c.fromBlockNumber, "headNum", headNum)
// In case interval between checks is set smaller than block mining time,
// we might need to wait for the next block to be mined
if c.fromBlockNumber.Cmp(headNum) > 0 {
if c.fromBlockNumber.Cmp(headNum) >= 0 {
return
}