mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-01 03:01:09 +02:00
Check descriptors returned by external signers
Check that descriptors returned by external signers have been parsed properly when creating a new wallet.
This commit is contained in:
@ -3203,8 +3203,11 @@ void CWallet::SetupDescriptorScriptPubKeyMans()
|
||||
for (const UniValue& desc_val : descriptor_vals.get_array().getValues()) {
|
||||
std::string desc_str = desc_val.getValStr();
|
||||
FlatSigningProvider keys;
|
||||
std::string dummy_error;
|
||||
std::unique_ptr<Descriptor> desc = Parse(desc_str, keys, dummy_error, false);
|
||||
std::string desc_error;
|
||||
std::unique_ptr<Descriptor> desc = Parse(desc_str, keys, desc_error, false);
|
||||
if (desc == nullptr) {
|
||||
throw std::runtime_error(std::string(__func__) + ": Invalid descriptor \"" + desc_str + "\" (" + desc_error + ")");
|
||||
}
|
||||
if (!desc->GetOutputType()) {
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user