Browse Source

More verbose absurd fee exception message

master
Kristaps Kaupe 5 years ago
parent
commit
0e5eb2f3b1
No known key found for this signature in database
GPG Key ID: D47B1B4232B55437
  1. 6
      jmclient/jmclient/wallet.py

6
jmclient/jmclient/wallet.py

@ -84,8 +84,10 @@ def estimate_tx_fee(ins, outs, txtype='p2pkh', extra_bytes=0):
absurd_fee = jm_single().config.getint("POLICY", "absurd_fee_per_kb")
if fee_per_kb > absurd_fee:
#This error is considered critical; for safety reasons, shut down.
raise ValueError("Estimated fee per kB greater than absurd value: " + \
str(absurd_fee) + ", quitting.")
raise ValueError("Estimated fee " +
btc.fee_per_kb_to_str(fee_per_kb) +
" greater than absurd value " +
btc.fee_per_kb_to_str(absurd_fee) + ", quitting.")
if txtype in ['p2pkh', 'p2shMofN']:
tx_estimated_bytes = btc.estimate_tx_size(ins, outs, txtype) + extra_bytes
return int((tx_estimated_bytes * fee_per_kb)/Decimal(1000.0))

Loading…
Cancel
Save