Merge pull request #5756 from urbit/yu/pending-eth-watcher

eth-watcher: discard future pending logs in watchdog
This commit is contained in:
Philip Monk 2022-05-09 22:35:03 -07:00 committed by GitHub
commit 3b591c627d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,6 +367,17 @@
=/ dog=watchdog =/ dog=watchdog
?: restart *watchdog ?: restart *watchdog
(~(got by dogs.state) path.poke) (~(got by dogs.state) path.poke)
=+ pending=(sort ~(tap in ~(key by pending-logs.dog)) lth)
=? pending-logs.dog
?: restart |
?~ pending |
(gte i.pending from.config.poke)
?> ?=(^ pending)
:: if there are pending logs newer than what we poke with,
:: we need to clear those too avoid processing duplicates
::
~& %dropping-unreleased-logs^[from+i.pending n+(lent pending)]
~
%_ dog %_ dog
- config.poke - config.poke
number from.config.poke number from.config.poke