- Refactors store_update_locator_map name to create_append_locator_map, which is a better fit.
- Adds update_locator_map method to update maps by removing some uuids (store_update_locator_map was not covering this, what was misleading).
- Adds missing docs.
- Improves code modularity.
- Separates flag_triggered from delete_appointment, which was pretty misleading (and causing some minor bugs) and make them work with lists intead of single objects.
- Removes unused import
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.
Data used to be stored both in memory and disk (db). This commits modifies the Watcher, Responder and Cleaner so they only keep the needed maps and load information from disk when necessary.
ChainMonitor is the actor in charge of checking new blocks. It improves from the previous zmq_subscriber by also doing polling and, therefore, making sure that no blocks are missed.
Documentation and tests are still required. Partially covers #31
get_missed_blocks is always called after calling find_last_common_ancestor, so the later was called twice returning the same value as the input. It does not seem to be any reason for it atm.
The API was never made an object since I couldn't find a way or working around the Flask decorators.
By using dispatch we can get around the issues in #14 and will be able to create better mocks for the API
Appointment serialization used to be part of the cryptographer (signature_format) but it makes more sense to be an appointment method. Therefore cli also need Appointment
Also fixes comments based on reviews
The Watcher used to receive a secret key file path ion the __init__ to load a secret key for signing. That made testing the Watcher hard, since the file needed to be present. Changing it so the main (pisad) loads the file from disk and passes the data the Watcher on init.