MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetPrivKey

Method GetPrivKey

src/script/descriptor.cpp:332–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330 bool m_xonly;
331
332 std::optional<CKey> GetPrivKey(const SigningProvider& arg) const
333 {
334 CKey key;
335 if (!(m_xonly ? arg.GetKeyByXOnly(XOnlyPubKey(m_pubkey), key) :
336 arg.GetKey(m_pubkey.GetID(), key))) return std::nullopt;
337 return key;
338 }
339
340public:
341 ConstPubkeyProvider(uint32_t exp_index, const CPubKey& pubkey, bool xonly) : PubkeyProvider(exp_index), m_pubkey(pubkey), m_xonly(xonly) {}

Callers 7

GetPrivKeyMethod · 0.45
GetPrivKeyMethod · 0.45
HavePrivateKeysMethod · 0.45
ExpandPrivateMethod · 0.45
key.cppFile · 0.45
WalletMigrationFunction · 0.45

Calls 6

GetKeyByXOnlyMethod · 0.80
emplaceMethod · 0.80
XOnlyPubKeyClass · 0.70
GetKeyMethod · 0.45
GetIDMethod · 0.45
GetPubKeyMethod · 0.45

Tested by

no test coverage detected