Fix range for ERC20/1155/721 tx detection (#4746)
This commit is contained in:
parent
582927868d
commit
9e36df449e
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue