From 5480b7dff50eaac8a10af9fc7d17c8e0a6f410c9 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 7 Oct 2017 12:54:50 +0200 Subject: [PATCH] add_input_info: add txin value for RBF with segwit inputs --- lib/wallet.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/wallet.py b/lib/wallet.py index c3d2eb868..4a7a1f1cd 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -1073,6 +1073,12 @@ class Abstract_Wallet(PrintError): address = txin['address'] if self.is_mine(address): txin['type'] = self.get_txin_type(address) + # segwit needs value to sign + if txin.get('value') is None and txin['type'] in ['p2wpkh', 'p2wsh', 'p2wpkh-p2sh', 'p2wsh-p2sh']: + received, spent = self.get_addr_io(address) + item = received.get(txin['prevout_hash']+':%d'%txin['prevout_n']) + tx_height, value, is_cb = item + txin['value'] = value self.add_input_sig_info(txin, address) def can_sign(self, tx):