Skip to content

Commit aa8a6ee

Browse files
committed
Fix poll limit
1 parent b54cf9a commit aa8a6ee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/orchestrator/poller.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,13 @@ func (p *Poller) stageResults(blockData []common.BlockData) error {
288288
}
289289

290290
func (p *Poller) reachedPollLimit(blockNumber *big.Int) bool {
291-
return blockNumber == nil || (p.pollUntilBlock.Sign() > 0 && blockNumber.Cmp(p.pollUntilBlock) >= 0)
291+
if blockNumber == nil {
292+
return true
293+
}
294+
if p.pollUntilBlock == nil || p.pollUntilBlock.Sign() == 0 {
295+
return false
296+
}
297+
return blockNumber.Cmp(p.pollUntilBlock) >= 0
292298
}
293299

294300
func (p *Poller) getNextBlockRange(ctx context.Context) ([]*big.Int, error) {

0 commit comments

Comments
 (0)