File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/reku/src/event/crosschecker Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -88,11 +88,19 @@ export class AutoCrossChecker extends BaseCrossChecker {
88
88
89
89
const waitNextCrosscheck = async ( ) : Promise < boolean > => {
90
90
latestBlockNum = await timeoutWithRetry ( ( ) => this . provider . provider ?. getBlockNumber ( ) , 15 * 1000 , 3 )
91
+
92
+ // If auto-follow is enabled, update toBlock and check block range
91
93
if ( options . autoFollowLatestBlock ) {
92
94
ccrOptions . toBlock = latestBlockNum
95
+
96
+ // Check if the range exceeds the latest block number
97
+ if ( ccrOptions . fromBlock + batchBlocksCount + delayBlockFromLatest > latestBlockNum )
98
+ return false
99
+
93
100
return true
94
101
}
95
102
103
+ // If auto-follow is not enabled, check if toBlock is within the delay range
96
104
if ( ccrOptions . toBlock + delayBlockFromLatest > latestBlockNum ) {
97
105
// sleep until the toBlock
98
106
// await sleep((ccrOptions.toBlock + delayBlockFromLatest - latestBlockNum) * blockInterval)
You can’t perform that action at this time.
0 commit comments