From 56aec439be1a7848a8e5ac42c61150c215eba39c Mon Sep 17 00:00:00 2001 From: AdamISZ Date: Sat, 5 May 2018 18:15:57 +0200 Subject: [PATCH] If order filtering/choosing fails, don't call on_finished_callback Prior to this commit, if a user chose to reject offers, or the offers choosing process failed for another reason, the on_finished_callback of the Taker was called, as well as the return value passed to the client protocol being "False", and both execution paths called reactor.stop(), resulting in an Exception in twisted (a reactor can only be stopped once). This commit fixes that by only stopping the reactor in the client protocol code (and only in cases of 1 sendpayment; for multiple tx runs, it waits and restarts). --- jmclient/jmclient/taker.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/jmclient/jmclient/taker.py b/jmclient/jmclient/taker.py index 1760af8..8bd8b34 100644 --- a/jmclient/jmclient/taker.py +++ b/jmclient/jmclient/taker.py @@ -196,7 +196,6 @@ class Taker(object): #`if self.orderbook is None` return False if not accepted: - self.on_finished_callback(False) return False return True @@ -262,7 +261,6 @@ class Taker(object): if not self.filter_orders_callback((self.orderbook, self.total_cj_fee), self.cjamount): - self.on_finished_callback(False) return False self.utxos = {None: self.input_utxos.keys()}