Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
added warning for sendpayment fees above 2% to make it harder for the…
Browse files Browse the repository at this point in the history
… bottom feeds who offer 50% fees
  • Loading branch information
chris-belcher committed Jul 20, 2015
1 parent ad749d7 commit be8b63f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions sendpayment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
from irc import IRCMessageChannel, random_nick
import bitcoin as btc

def check_high_fee(total_fee_pc):
debug('total coinjoin fee = ' + str(float('%.3g' % (100.0 * total_fee_pc))) + '%')
WARNING_THRESHOLD = 0.02 # 2%
if total_fee_pc > WARNING_THRESHOLD:
print '\n'.join(['='* 60]*3)
print 'WARNING ' * 6
print '\n'.join(['='* 60]*1)
print 'OFFERED FEE IS INSANELY LARGE.'*2
print '\n'.join(['='* 60]*1)
print 'WARNING ' * 6
print '\n'.join(['='* 60]*3)


#thread which does the buy-side algorithm
# chooses which coinjoins to initiate and when
Expand Down Expand Up @@ -44,6 +56,9 @@ def run(self):

orders, cjamount = choose_sweep_order(self.taker.db, total_value, self.taker.txfee, self.taker.makercount, chooseOrdersBy)
if not self.taker.answeryes:
debug('total cj fee = ' + str(total_value - cjamount))
total_fee_pc = 1.0*(total_value - cjamount) / cjamount
check_high_fee(total_fee_pc)
if raw_input('send with these orders? (y/n):')[0] != 'y':
self.finishcallback(None)
return
Expand All @@ -63,6 +78,8 @@ def run(self):
return
print 'chosen orders to fill ' + str(orders) + ' totalcjfee=' + str(total_cj_fee)
if not self.taker.answeryes:
total_fee_pc = 1.0*total_cj_fee / self.taker.amount
check_high_fee(total_fee_pc)
if raw_input('send with these orders? (y/n):')[0] != 'y':
self.finishcallback(None)
return
Expand Down

0 comments on commit be8b63f

Please sign in to comment.