diff options
author | Ivan Metlushko <metlushko@gmail.com> | 2020-10-15 18:02:58 +0700 |
---|---|---|
committer | Ivan Metlushko <metlushko@gmail.com> | 2020-10-15 18:02:58 +0700 |
commit | 538be4219ae7e65862e4aff540af88c9421e6061 (patch) | |
tree | ce25540988e4834c81077c6f9b895522e51ef211 /src/wallet/rpcdump.cpp | |
parent | 711ddce94377aea38ce30fa93b3ee8ea1d96ba98 (diff) |
wallet: fix importdescriptor silent fail
Diffstat (limited to 'src/wallet/rpcdump.cpp')
-rw-r--r-- | src/wallet/rpcdump.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 7dcab46ad3..fe621382a3 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -1522,7 +1522,9 @@ static UniValue ProcessDescriptorImport(CWallet * const pwallet, const UniValue& // Need to ExpandPrivate to check if private keys are available for all pubkeys FlatSigningProvider expand_keys; std::vector<CScript> scripts; - parsed_desc->Expand(0, keys, scripts, expand_keys); + if (!parsed_desc->Expand(0, keys, scripts, expand_keys)) { + throw JSONRPCError(RPC_WALLET_ERROR, "Cannot expand descriptor. Probably because of hardened derivations without private keys provided"); + } parsed_desc->ExpandPrivate(0, keys, expand_keys); // Check if all private keys are provided |