Fix range for ERC20/1155/721 tx detection (#4746)

This commit is contained in:
Roman Volosovskyi 2024-02-19 11:50:03 +01:00 committed by GitHub
parent 582927868d
commit 9e36df449e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -1 +1 @@
0.174.8 0.174.9

View File

@ -241,10 +241,15 @@ func (c *findNewBlocksCommand) Run(parent context.Context) error {
} }
if len(accountsWithDetectedChanges) != 0 || c.iteration%c.logsCheckIntervalIterations == 0 { if len(accountsWithDetectedChanges) != 0 || c.iteration%c.logsCheckIntervalIterations == 0 {
err = c.findAndSaveTokenBlocks(parent, c.fromBlockNumber, headNum) from := c.fromBlockNumber
if c.logsCheckLastKnownBlock != nil {
from = c.logsCheckLastKnownBlock
}
err = c.findAndSaveTokenBlocks(parent, from, headNum)
if err != nil { if err != nil {
return err return err
} }
c.logsCheckLastKnownBlock = headNum
} }
c.fromBlockNumber = headNum c.fromBlockNumber = headNum
c.iteration++ c.iteration++
@ -435,6 +440,7 @@ type findBlocksCommand struct {
transactionManager *TransactionManager transactionManager *TransactionManager
tokenManager *token.Manager tokenManager *token.Manager
fromBlockNumber *big.Int fromBlockNumber *big.Int
logsCheckLastKnownBlock *big.Int
toBlockNumber *big.Int toBlockNumber *big.Int
blocksLoadedCh chan<- []*DBHeader blocksLoadedCh chan<- []*DBHeader
defaultNodeBlockChunkSize int defaultNodeBlockChunkSize int