Skip to content

Commit 9d5d33d

Browse files
authored
Merge pull request #229 from thirdweb-dev/06-20-handle_reset_chains
handle reset chains
2 parents 6a72a39 + 05d334a commit 9d5d33d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/orchestrator/committer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ func (c *Committer) getBlockNumbersToCommit(ctx context.Context) ([]*big.Int, er
135135
}
136136

137137
blockCount := new(big.Int).Sub(endBlock, startBlock).Int64() + 1
138+
if blockCount < 1 {
139+
return []*big.Int{}, fmt.Errorf("more blocks have been committed than the RPC has available - possible chain reset")
140+
}
138141
blockNumbers := make([]*big.Int, blockCount)
139142
for i := int64(0); i < blockCount; i++ {
140143
blockNumber := new(big.Int).Add(startBlock, big.NewInt(i))

0 commit comments

Comments
 (0)