diff --git a/.gitignore b/.gitignore index d52868f..bb59834 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ logs/ .DS_Store .idea +venv/* conf.py bitcoin.conf* *__pycache__ diff --git a/pisa-btc/TODO.md b/pisa-btc/TODO.md index 56049b4..20eaf52 100644 --- a/pisa-btc/TODO.md +++ b/pisa-btc/TODO.md @@ -1,3 +1,8 @@ -- Check all the interactions with core, figure out the edge cases and error codes -i.e: The justice transaction can already be in the blockchain the first time we push it -- Handle reconnection with ZMQ in case of broken pipe. The current version of the code fails if it does happen +- Start jobs according to the start time, jobs are now started when they are received +- Add DB +- Store jobs in DB until start time? +- Handle failures in the underlying system (i.e. bitcoind crashes) +- Add checks related with OP_CSV in justice tx and dispute_delta provided once the blob is decrypted +- Do not accept new appointments if the locator has already been used +- Check all the interactions with core, figure out the edge cases and error codes i.e: The justice transaction can already be in the blockchain the first time we push it +- Handle reconnection with ZMQ in case of broken pipe. The current version of the code fails if it does happen diff --git a/pisa-btc/apps/cli/pisa-cli.py b/pisa-btc/apps/cli/pisa-cli.py index 48c73cf..1992225 100644 --- a/pisa-btc/apps/cli/pisa-cli.py +++ b/pisa-btc/apps/cli/pisa-cli.py @@ -146,6 +146,7 @@ def check_txid_format(txid): if len(txid) != 64: sys.exit("locator does not matches the expected size (32-byte / 64 hex chars).") + # TODO: Check this regexp return re.search(r'^[0-9A-Fa-f]+$', txid) is not None diff --git a/pisa-btc/pisa/inspector.py b/pisa-btc/pisa/inspector.py index f541dd2..0eb392c 100644 --- a/pisa-btc/pisa/inspector.py +++ b/pisa-btc/pisa/inspector.py @@ -63,6 +63,7 @@ class Inspector: elif len(locator) != 64: rcode = errors.APPOINTMENT_WRONG_FIELD_SIZE message = "wrong locator size ({})".format(len(locator)) + # TODO: Check this regexp elif re.search(r'^[0-9A-Fa-f]+$', locator) is None: rcode = errors.APPOINTMENT_WRONG_FIELD_FORMAT message = "wrong locator format ({})".format(locator) @@ -161,7 +162,7 @@ class Inspector: elif encrypted_blob == '': # ToDo: We may want to define this to be at least as long as one block of the cipher we are using rcode = errors.APPOINTMENT_WRONG_FIELD - message = "wrong encrypted_blob".format(t) + message = "wrong encrypted_blob" if self.debug and message: self.logging.error("[Inspector] {}".format(message))