diff options
author | Antoine Poinsot <darosior@protonmail.com> | 2022-07-19 11:44:04 +0200 |
---|---|---|
committer | Antoine Poinsot <darosior@protonmail.com> | 2022-08-04 11:32:25 +0200 |
commit | 8dc6670ce159c2b080e9f735c6603a601d40b6ac (patch) | |
tree | 77d2c888cf006eff2a971a1da02b8b1c42dca6be | |
parent | 50cfc9e7613d6cf6b534df6e551238b80678c70d (diff) | |
download | bitcoin-8dc6670ce159c2b080e9f735c6603a601d40b6ac.tar.xz |
descriptor: don't assert success of extended key derivation
It might already fail, and we'll add another failure case.
-rw-r--r-- | src/script/descriptor.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index 346a86cad8..9bdffad89b 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -388,14 +388,13 @@ public: } } else { for (auto entry : m_path) { - der = parent_extkey.Derive(parent_extkey, entry); - assert(der); + if (!parent_extkey.Derive(parent_extkey, entry)) return false; } final_extkey = parent_extkey; if (m_derive == DeriveType::UNHARDENED) der = parent_extkey.Derive(final_extkey, pos); assert(m_derive != DeriveType::HARDENED); } - assert(der); + if (!der) return false; final_info_out = final_info_out_tmp; key_out = final_extkey.pubkey; |