Skip to content

Commit

Permalink
Fix importprivkey on fidelity bond wallets
Browse files Browse the repository at this point in the history
Previously importing a private key would result in a crash
  • Loading branch information
chris-belcher committed Jul 6, 2021
1 parent 9a4ef90 commit 3c20d17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion jmclient/jmclient/cryptoengine.py
Expand Up @@ -440,5 +440,6 @@ def sign_transaction(cls, tx, index, privkey, amount,
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 changes: 2 additions & 1 deletion jmclient/jmclient/wallet_utils.py
Expand Up @@ -246,7 +246,8 @@ def __init__(self, wallet_path_repr, account, branches=None, account_name="mixde
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

Expand Down

0 comments on commit 3c20d17

Please sign in to comment.