Browse Source

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.
master
Adam Gibson 8 years ago
parent
commit
50bc247440
No known key found for this signature in database
GPG Key ID: B3AE09F1E9A3197A
  1. 3
      jmclient/jmclient/wallet_utils.py

3
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']:

Loading…
Cancel
Save