From 3dc8d86b4458de0748c3f68bd897084122efae5d Mon Sep 17 00:00:00 2001 From: chris-belcher Date: Sat, 3 Jul 2021 12:06:24 +0100 Subject: [PATCH] Fix importprivkey on fidelity bond wallets Previously importing a private key would result in a crash --- jmclient/jmclient/cryptoengine.py | 3 ++- jmclient/jmclient/wallet_utils.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jmclient/jmclient/cryptoengine.py b/jmclient/jmclient/cryptoengine.py index 52bd96e..f5d2a2a 100644 --- a/jmclient/jmclient/cryptoengine.py +++ b/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 } diff --git a/jmclient/jmclient/wallet_utils.py b/jmclient/jmclient/wallet_utils.py index d574371..5c1d3f8 100644 --- a/jmclient/jmclient/wallet_utils.py +++ b/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