Browse Source

Fixes reactor.stop bug when no commitments fit size restraint

See commit 56aec439be ; this fix
fixes the same issue relating to commitments.
master
AdamISZ 7 years ago
parent
commit
5802c57354
No known key found for this signature in database
GPG Key ID: B3AE09F1E9A3197A
  1. 5
      jmclient/jmclient/client_protocol.py
  2. 4
      jmclient/jmclient/taker.py
  3. 2
      jmclient/test/test_taker.py

5
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,

4
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)

2
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)

Loading…
Cancel
Save