mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-18 14:44:21 +01:00
Deletes appointment from Watcher's db if a tracker cannot be added
There was a bug in the Responder where, if a tracker could not be added (e.g. malformed tx) the data was dropped but never removed from the Watcher's db. This is due to flagging appointments as triggered instead of deleting them from the Watcher's db straight away (in order to deal with reorgs in the future). If that approach is not followed, and appointments are removed from the Watcher's db once they are passed to the Responder, this should be removed since it would be redundant.
This commit is contained in:
@@ -213,7 +213,11 @@ class Responder:
|
||||
logger.warning(
|
||||
"Tracker cannot be created", reason=receipt.reason, uuid=uuid, on_sync=self.on_sync(block_hash)
|
||||
)
|
||||
pass
|
||||
|
||||
# FIXME: This is only necessary because of the triggered appointment approach. Remove if it changes.
|
||||
self.db_manager.delete_watcher_appointment(uuid)
|
||||
self.db_manager.delete_triggered_appointment_flag(uuid)
|
||||
Cleaner.update_delete_locator_map(locator, uuid, self.db_manager)
|
||||
|
||||
return receipt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user