From ccc878ae30e2ce8cc0ade7dcf22012cf004b2011 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Sat, 1 Jul 2017 23:14:05 +0300 Subject: [PATCH] support 2of2 txfee estimate --- jmclient/jmclient/wallet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jmclient/jmclient/wallet.py b/jmclient/jmclient/wallet.py index 21fc6c0..2f7ed06 100644 --- a/jmclient/jmclient/wallet.py +++ b/jmclient/jmclient/wallet.py @@ -36,7 +36,7 @@ def estimate_tx_fee(ins, outs, txtype='p2pkh'): #This error is considered critical; for safety reasons, shut down. raise ValueError("Estimated fee per kB greater than absurd value: " + \ str(absurd_fee) + ", quitting.") - if txtype=='p2pkh': + if txtype in ['p2pkh', 'p2shMofN']: tx_estimated_bytes = btc.estimate_tx_size(ins, outs, txtype) log.debug("Estimated transaction size: "+str(tx_estimated_bytes)) return int((tx_estimated_bytes * fee_per_kb)/Decimal(1000.0)) @@ -45,6 +45,8 @@ def estimate_tx_fee(ins, outs, txtype='p2pkh'): ins, outs, 'p2sh-p2wpkh') return int(int(( non_witness_estimate + 0.25*witness_estimate)*fee_per_kb)/Decimal(1000.0)) + else: + raise NotImplementedError("Txtype: " + txtype + " not implemented.") def create_wallet_file(pwd, seed): password_key = btc.bin_dbl_sha256(pwd)