diff --git a/jmclient/jmclient/taker.py b/jmclient/jmclient/taker.py index 423370f..06f1eda 100644 --- a/jmclient/jmclient/taker.py +++ b/jmclient/jmclient/taker.py @@ -163,6 +163,12 @@ class Taker(object): accepted = self.filter_orders_callback([self.orderbook, self.total_cj_fee], self.cjamount) + if accepted == "retry": + #Special condition if Taker is "determined to continue" + #(such as tumbler); even though these offers are rejected, + #we don't trigger the finished callback; see above note on + #`if self.orderbook is None` + return False if not accepted: self.on_finished_callback(False) return False diff --git a/scripts/tumbler.py b/scripts/tumbler.py index 51eafe0..5c6b869 100644 --- a/scripts/tumbler.py +++ b/scripts/tumbler.py @@ -126,6 +126,16 @@ def main(): #callback for order checking; dummy/passthrough def filter_orders_callback(orders_fees, cjamount): + orders, total_cj_fee = orders_fees + abs_cj_fee = 1.0 * total_cj_fee / taker.n_counterparties + rel_cj_fee = abs_cj_fee / cjamount + log.info('rel/abs average fee = ' + str(rel_cj_fee) + ' / ' + str( + abs_cj_fee)) + + if rel_cj_fee > options['maxcjfee'][ + 0] and abs_cj_fee > options['maxcjfee'][1]: + log.info("Rejected fees as too high according to options, will retry.") + return "retry" return True def taker_finished(res, fromtx=False, waittime=0.0, txdetails=None):