Commit Graph

38 Commits

Author SHA1 Message Date
Sergi Delgado Segura
df5dcbdfe9 Renames dispute_delta to to_self_delay and justice tx to penalty tx
Uses the naming convention followed by LN implementations and BOLTs
2019-12-11 12:45:05 +01:00
Sergi Delgado Segura
2cdd78b8e6 Simplifies the Cleaner and adds docstrings
We were passing some unnecessary parameters to the Cleaner (locator) that could be derived from other data (uuid and appointments). Also standarises the order of the  parameters to match the rest of the methods
2019-12-10 13:31:42 +01:00
Sergi Delgado Segura
5f7cd7e189 Delete old TODOs 2019-12-05 11:34:44 +01:00
Sergi Delgado Segura
bd08b151df Replaces locator with common/constants value 2019-12-05 11:03:36 +01:00
Sergi Delgado Segura
f0150ce585 Removes hash/cipher configuration and changes AESGCM128 for CHACHA20POLY1305
Updates tests accordingly
2019-12-04 17:46:07 +01:00
Sergi Delgado Segura
2183c57f53 Updates handle_reorgs and deletes check_tx_in_chain
Updates handle_reorg to work with the current version of the Responder (the old code was outdated and broken).

`check_tx_in_chain` was only used by `handle_reorgs`, and made not much sense at this point. The method need to check if the transaction is in mempool or blockchain, so it seems to make more sense bulding on top of `get_transaction`.
2019-11-20 15:41:50 +00:00
Sergi Delgado Segura
f65e2af675 Deletes missed print 2019-11-14 15:03:03 +00:00
Sergi Delgado Segura
c54d10f92c Fixes Responder
There were a couple of wrong things going on in the `Responder`:

- `check_confirmations` included in 8a10979db0 was not doing a good job keeping track of the missed confirmations, probably due to a overlooked refactor.

- There was an edge case when adding txs to `unconfirmed_txs` on `create_job` that may lead to a transaction being confirmed and unconfirmed at the same time from the `Responder's` pow. It could be triggered by adding two jobs with the same justice_txid.
2019-11-11 17:50:28 +00:00
Sergi Delgado Segura
8a10979db0 Refactors Responder and BlockProcessor
Brings check_confirmations back to the Responder
2019-11-08 16:25:40 +00:00
Sergi Delgado Segura
20f296c9d4 Reformats code to match code guidelines 2019-11-07 15:47:35 +00:00
Sergi Delgado Segura
99bda73eff Applies fixes after PR review 2019-11-07 15:07:58 +00:00
Sergi Delgado Segura
8ad3ae5f1d Initializes block_queue on init
Building from backed up data may require initializing the block queues of both the watcher and responder with the blocks they've missed.
2019-10-30 12:20:42 -07:00
Sergi Delgado Segura
bc7c7dc26f Fixes based on DBManager unit tests 2019-10-29 14:52:27 -07:00
Sergi Delgado Segura
15a66751b2 Additional bug-fixing 2019-10-28 14:49:53 -07:00
Sergi Delgado Segura
f61474216c Fixes and tests updates
Updates tests so they run with the db_manager and fixes some bugs introduced in d7d42c9.
2019-10-28 14:49:40 -07:00
Sergi Delgado Segura
162de92026 Adds class method to create from dict and on_sync method 2019-10-28 14:40:42 -07:00
Sergi Delgado Segura
db87fab9ee Fixes prefix encoding 2019-10-28 14:38:56 -07:00
Sergi Delgado Segura
a0538739d2 Starts data persistence integration
The difference between master and the old data-persistence branch was huge, seems more effective to manually cherry pick the changes and integrate them
2019-10-28 14:38:50 -07:00
Sergi Delgado Segura
af0e9c81b5 Adds some missing tests 2019-10-22 16:38:28 +01:00
Sergi Delgado Segura
be16d8af73 Improves responder.
Several changes have been performed:

- Retry counter has been removed (#23)
- Rebroadcast return receipts now
- Re-calling send_transaction if a fixable error occurs should be handled in the responder now (missing)
- Fixes some small bugs
2019-10-22 15:03:18 +01:00
Sergi Delgado Segura
71ce7c46ec Removes the parameters for do_subscribe + PEP8 2019-10-21 16:54:48 +01:00
Sergi Delgado Segura
c09becd7fa Fixes to_dict/to_json for and some fixes 2019-10-17 19:11:32 +01:00
Sergi Delgado Segura
d35b9c13c4 Fixes responder missing_confirmation dict access 2019-10-14 13:00:49 +01:00
Salvatore Ingala
d05c2c21b7 warn ==> warning 2019-10-10 18:39:54 +07:00
Salvatore Ingala
aea1d1f1e0 Fixes from PR review 2019-10-10 11:07:58 +07:00
Salvatore Ingala
dee93e5c62 Moved StructuredMessage and Logger to separate file; refactored pisa-cli logging using new format 2019-10-10 09:59:11 +07:00
Salvatore Ingala
4bcc8e20a0 Refactored check_tx_in_chain with new log format 2019-10-10 09:59:10 +07:00
Salvatore Ingala
bae9b6b913 Added Logger class; refactored logging accordingly 2019-10-10 09:59:10 +07:00
Salvatore Ingala
2a5dd48950 PEP8 linting 2019-10-10 09:58:27 +07:00
Salvatore Ingala
ed0cb4f632 Changed log format to JSON; fixed missing return value in get_potential_matches 2019-10-10 09:58:27 +07:00
Sergi Delgado Segura
8b62ff9e56 Update some comments/todos/discuss 2019-10-09 17:38:15 +01:00
Sergi Delgado Segura
1e18630ce2 Adds Cleaner tests. Fixes Cleaner, Watcher and Responder
There is no need to return the dictionaries modified by the client since they are "passed-by-reference" in Python.
2019-10-04 17:23:45 +01:00
Sergi Delgado Segura
4704462502 Increases responder modularity
The responder had way too complex functions. Separate them into smaller / more specific ones to increse modularity and code reuse.
2019-10-04 13:52:51 +01:00
Sergi Delgado Segura
3e0cca14d7 Clean up + higher modular design 2019-10-03 11:49:49 +01:00
Sergi Delgado Segura
93e23e769f Code clean up
Deletes debug/logging pair. Defines logging and bitcoin_cli as system-wide variables
2019-10-02 17:03:43 +01:00
Sergi Delgado Segura
ae2cf26195 Improves internal data structures and reorgs the code for readability 2019-08-26 16:26:29 +02:00
Sergi Delgado Segura
d34ccc46a1 Adds/Updates further comments and fixes small issues 2019-08-13 12:03:36 +01:00
Sergi Delgado Segura
1cde4a2a11 refactors project structure 2019-08-12 13:24:04 +01:00