Browse Source

Fix importprivkey on fidelity bond wallets

Previously importing a private key would result in a crash
master
chris-belcher 5 years ago
parent
commit
3dc8d86b44
No known key found for this signature in database
GPG Key ID: EF734EA677F31129
  1. 3
      jmclient/jmclient/cryptoengine.py
  2. 3
      jmclient/jmclient/wallet_utils.py

3
jmclient/jmclient/cryptoengine.py

@ -440,5 +440,6 @@ ENGINES = {
TYPE_P2WPKH: BTC_P2WPKH,
TYPE_TIMELOCK_P2WSH: BTC_Timelocked_P2WSH,
TYPE_WATCHONLY_TIMELOCK_P2WSH: BTC_Watchonly_Timelocked_P2WSH,
TYPE_WATCHONLY_P2WPKH: BTC_Watchonly_P2WPKH
TYPE_WATCHONLY_P2WPKH: BTC_Watchonly_P2WPKH,
TYPE_SEGWIT_WALLET_FIDELITY_BONDS: BTC_P2WPKH
}

3
jmclient/jmclient/wallet_utils.py

@ -246,7 +246,8 @@ class WalletViewAccount(WalletViewBase):
self.account_name = account_name
self.xpub = xpub
if branches:
assert len(branches) in [2, 3, 4] #3 if imported keys, 4 if fidelity bonds
assert len(branches) in [2, 3, 4, 5] #3 if imported keys, 4 if fidelity bonds
#5 if all those plus imported
assert all([isinstance(x, WalletViewBranch) for x in branches])
self.branches = branches

Loading…
Cancel
Save