Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix edge case where existing range end block causes crashes (#121)
### TL;DR Improved error handling and logging for blockchain polling operations ### What changed? - Added a new `ErrNoNewBlocks` error type to explicitly handle cases when no new blocks are available - Updated error logging to suppress errors when no new blocks are found - Enhanced the `reachedPollLimit` function to handle nil block numbers - Modified `getNextBlockRange` to return `ErrNoNewBlocks` instead of nil when no blocks are available ### How to test? 1. Run the poller with a blockchain that has no new blocks 2. Verify that no error messages appear in the logs 3. Test with nil block numbers to ensure proper handling 4. Verify that polling continues normally when new blocks become available ### Why make this change? The previous implementation would log errors for expected scenarios (like no new blocks being available), creating unnecessary noise in the logs. This change provides clearer error handling and better distinguishes between actual errors and expected states, making the system easier to monitor and debug.
- Loading branch information