Skip to content

Commit 8dc6670

Browse files
committed
descriptor: don't assert success of extended key derivation
It might already fail, and we'll add another failure case.
1 parent 50cfc9e commit 8dc6670

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/script/descriptor.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,14 +388,13 @@ class BIP32PubkeyProvider final : public PubkeyProvider
388388
}
389389
} else {
390390
for (auto entry : m_path) {
391-
der = parent_extkey.Derive(parent_extkey, entry);
392-
assert(der);
391+
if (!parent_extkey.Derive(parent_extkey, entry)) return false;
393392
}
394393
final_extkey = parent_extkey;
395394
if (m_derive == DeriveType::UNHARDENED) der = parent_extkey.Derive(final_extkey, pos);
396395
assert(m_derive != DeriveType::HARDENED);
397396
}
398-
assert(der);
397+
if (!der) return false;
399398

400399
final_info_out = final_info_out_tmp;
401400
key_out = final_extkey.pubkey;

0 commit comments

Comments
 (0)