aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/walletutil.h')
-rw-r--r--src/wallet/walletutil.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/wallet/walletutil.h b/src/wallet/walletutil.h
index 38926c1eb8..ef9d93eb07 100644
--- a/src/wallet/walletutil.h
+++ b/src/wallet/walletutil.h
@@ -96,10 +96,14 @@ public:
{
std::string error;
FlatSigningProvider keys;
- descriptor = Parse(str, keys, error, true);
- if (!descriptor) {
+ auto descs = Parse(str, keys, error, true);
+ if (descs.empty()) {
throw std::ios_base::failure("Invalid descriptor: " + error);
}
+ if (descs.size() > 1) {
+ throw std::ios_base::failure("Can't load a multipath descriptor from databases");
+ }
+ descriptor = std::move(descs.at(0));
id = DescriptorID(*descriptor);
}
@@ -111,7 +115,7 @@ public:
SER_READ(obj, obj.DeserializeDescriptor(descriptor_str));
}
- WalletDescriptor() {}
+ WalletDescriptor() = default;
WalletDescriptor(std::shared_ptr<Descriptor> descriptor, uint64_t creation_time, int32_t range_start, int32_t range_end, int32_t next_index) : descriptor(descriptor), id(DescriptorID(*descriptor)), creation_time(creation_time), range_start(range_start), range_end(range_end), next_index(next_index) { }
};