From d35b9c13c463c26d3319a42117d405c2458ebbda Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Mon, 14 Oct 2019 13:00:49 +0100 Subject: [PATCH] Fixes responder missing_confirmation dict access --- pisa/responder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pisa/responder.py b/pisa/responder.py index 87f64ec..0b948e0 100644 --- a/pisa/responder.py +++ b/pisa/responder.py @@ -68,7 +68,7 @@ class Responder: # ToDo: #23-define-behaviour-approaching-end if retry: self.jobs[uuid].retry_counter += 1 - self.jobs[uuid].missed_confirmations = 0 + self.missed_confirmations[justice_txid] = 0 else: self.jobs[uuid] = Job(dispute_txid, justice_txid, justice_rawtx, appointment_end, confirmations) @@ -144,7 +144,7 @@ class Responder: txs_to_rebroadcast = [] for tx in txs: - if self.missed_confirmations[tx] >= CONFIRMATIONS_BEFORE_RETRY: + if tx in self.missed_confirmations and self.missed_confirmations[tx] >= CONFIRMATIONS_BEFORE_RETRY: # If a transactions has missed too many confirmations we add it to the rebroadcast list txs_to_rebroadcast.append(tx) @@ -153,7 +153,7 @@ class Responder: def get_completed_jobs(self, height): completed_jobs = [] - for uuid, job in self.jobs: + for uuid, job in self.jobs.items(): if job.appointment_end <= height: tx = Carrier.get_transaction(job.dispute_txid)