diff --git a/jmclient/jmclient/client_protocol.py b/jmclient/jmclient/client_protocol.py index b3b214f..5a9b2d8 100644 --- a/jmclient/jmclient/client_protocol.py +++ b/jmclient/jmclient/client_protocol.py @@ -413,6 +413,11 @@ class JMTakerClientProtocol(JMClientProtocol): #but is not the functionality desired in general (tumbler). self.client.on_finished_callback(False, False, 0.0) return {'accepted': True} + elif retval[0] == "commitment-failure": + #This case occurs if we cannot find any utxos for reasons + #other than age, which is a permanent failure + self.client.on_finished_callback(False, False, 0.0) + return {'accepted': True} amt, cmt, rev, foffers = retval[1:] d = self.callRemote(commands.JMFill, amount=amt, diff --git a/jmclient/jmclient/taker.py b/jmclient/jmclient/taker.py index 5439b7f..0214a40 100644 --- a/jmclient/jmclient/taker.py +++ b/jmclient/jmclient/taker.py @@ -209,10 +209,10 @@ class Taker(object): #(TODO, it's possible for user to dynamically add more coins, #consider if this option means we should stay alive). self.taker_info_callback("ABORT", errmsg) - self.on_finished_callback(False) + return ("commitment-failure",) else: self.taker_info_callback("INFO", errmsg) - return (False,) + return (False,) else: self.taker_info_callback("INFO", errmsg) diff --git a/jmclient/test/test_taker.py b/jmclient/test/test_taker.py index 7b20ca7..b91bca7 100644 --- a/jmclient/test/test_taker.py +++ b/jmclient/test/test_taker.py @@ -254,7 +254,7 @@ def test_taker_init(createcmtdata, schedule, highfee, toomuchcoins, minmakers, return clean_up() if nocommit: print(str(res)) - assert not res[0] + assert res[0] == "commitment-failure" return clean_up() taker.orderbook = copy.deepcopy(t_chosen_orders) #total_cjfee unaffected, all same maker_response = copy.deepcopy(t_maker_response)