Browse Source

Allow custom schedules to work again after #367

PR #367 and follow up edits were designed to give a sanity
check to users for fees, but require specifying a payment
amount, this could be generalised to custom schedules but
for now the simplest change is to remove this check for
schedules. Thanks to @roshii for flagging the error.
master
Adam Gibson 6 years ago
parent
commit
d9bcca3901
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 32
      scripts/sendpayment.py

32
scripts/sendpayment.py

@ -145,22 +145,24 @@ def main():
# From the estimated tx fees, check if the expected amount is a # From the estimated tx fees, check if the expected amount is a
# significant value compared the the cj amount # significant value compared the the cj amount; currently enabled
total_cj_amount = amount # only for single join (the predominant, non-advanced case)
if total_cj_amount == 0: if options.schedule == '':
total_cj_amount = wallet_service.get_balance_by_mixdepth()[options.mixdepth] total_cj_amount = amount
if total_cj_amount == 0: if total_cj_amount == 0:
raise ValueError("No confirmed coins in the selected mixdepth. Quitting") total_cj_amount = wallet_service.get_balance_by_mixdepth()[options.mixdepth]
exp_tx_fees_ratio = ((1 + options.makercount) * options.txfee) / total_cj_amount if total_cj_amount == 0:
if exp_tx_fees_ratio > 0.05: raise ValueError("No confirmed coins in the selected mixdepth. Quitting")
jmprint('WARNING: Expected bitcoin network miner fees for this coinjoin' exp_tx_fees_ratio = ((1 + options.makercount) * options.txfee) / total_cj_amount
' amount are roughly {:.1%}'.format(exp_tx_fees_ratio), "warning") if exp_tx_fees_ratio > 0.05:
if input('You might want to modify your tx_fee' jmprint('WARNING: Expected bitcoin network miner fees for this coinjoin'
' settings in joinmarket.cfg. Still continue? (y/n):')[0] != 'y': ' amount are roughly {:.1%}'.format(exp_tx_fees_ratio), "warning")
sys.exit('Aborted by user.') if input('You might want to modify your tx_fee'
else: ' settings in joinmarket.cfg. Still continue? (y/n):')[0] != 'y':
log.info("Estimated miner/tx fees for this coinjoin amount: {:.1%}" sys.exit('Aborted by user.')
.format(exp_tx_fees_ratio)) else:
log.info("Estimated miner/tx fees for this coinjoin amount: {:.1%}"
.format(exp_tx_fees_ratio))
if options.makercount == 0 and not options.p2ep: if options.makercount == 0 and not options.p2ep:
direct_send(wallet_service, amount, mixdepth, destaddr, options.answeryes) direct_send(wallet_service, amount, mixdepth, destaddr, options.answeryes)

Loading…
Cancel
Save