Browse Source

tumbler: implement maxcjfee in filter_orders

master
Adam Gibson 9 years ago
parent
commit
e8a2fce40e
No known key found for this signature in database
GPG Key ID: B3AE09F1E9A3197A
  1. 6
      jmclient/jmclient/taker.py
  2. 10
      scripts/tumbler.py

6
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

10
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):

Loading…
Cancel
Save