Reconstruct the extended private key for an HD xpub. Returns nullopt when no descriptor has the private key, or the wallet is locked.

Synopsis

Declared in <wallet/wallet.h>

std::optional<CExtKey>
GetExtKey(CExtPubKey const& xpub) const;

Return Value

The extended private key, or nullopt if unavailable.

Parameters

Name

Description

xpub

The extended public key to reconstruct the private key for.

Created with MrDocs