Browse Source

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).
master
AdamISZ 8 years ago
parent
commit
56aec439be
No known key found for this signature in database
GPG Key ID: B3AE09F1E9A3197A
  1. 2
      jmclient/jmclient/taker.py

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

Loading…
Cancel
Save