From 0e5eb2f3b1a21ec2916d21920ee06731024a01b9 Mon Sep 17 00:00:00 2001 From: Kristaps Kaupe Date: Thu, 3 Sep 2020 22:32:05 +0300 Subject: [PATCH] More verbose absurd fee exception message --- jmclient/jmclient/wallet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jmclient/jmclient/wallet.py b/jmclient/jmclient/wallet.py index 36cb271..278c14e 100644 --- a/jmclient/jmclient/wallet.py +++ b/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))