From 50bc2474409963462bf641219215c27d671e9a83 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 17 Nov 2017 22:56:59 +0200 Subject: [PATCH] Fix address for imported key (p2sh/p2wpkh) Note that this does not fix *usage* of the coins corresponding to the imported key, which is currently not working. A further fix is needed for coin selection and display. --- jmclient/jmclient/wallet_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jmclient/jmclient/wallet_utils.py b/jmclient/jmclient/wallet_utils.py index 7bc7d22..5a0c22c 100644 --- a/jmclient/jmclient/wallet_utils.py +++ b/jmclient/jmclient/wallet_utils.py @@ -280,7 +280,8 @@ def get_imported_privkey_branch(wallet, m, showprivkey): if m in wallet.imported_privkeys: entries = [] for i, privkey in enumerate(wallet.imported_privkeys[m]): - addr = btc.privtoaddr(privkey, magicbyte=get_p2sh_vbyte()) + pub = btc.privkey_to_pubkey(privkey) + addr = btc.pubkey_to_p2sh_p2wpkh_address(pub, magicbyte=get_p2sh_vbyte()) balance = 0.0 for addrvalue in wallet.unspent.values(): if addr == addrvalue['address']: