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

Function GetPubKey

src/script/sign.cpp:237–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237static bool GetPubKey(const SigningProvider& provider, const SignatureData& sigdata, const CKeyID& address, CPubKey& pubkey)
238{
239 // Look for pubkey in all partial sigs
240 const auto it = sigdata.signatures.find(address);
241 if (it != sigdata.signatures.end()) {
242 pubkey = it->second.first;
243 return true;
244 }
245 // Look for pubkey in pubkey lists
246 const auto& pk_it = sigdata.misc_pubkeys.find(address);
247 if (pk_it != sigdata.misc_pubkeys.end()) {
248 pubkey = pk_it->second.first;
249 return true;
250 }
251 const auto& tap_pk_it = sigdata.tap_pubkeys.find(address);
252 if (tap_pk_it != sigdata.tap_pubkeys.end()) {
253 pubkey = tap_pk_it->second.GetEvenCorrespondingCPubKey();
254 return true;
255 }
256 // Query the underlying provider
257 return provider.GetPubKey(address, pubkey);
258}
259
260static bool CreateSig(const BaseSignatureCreator& creator, SignatureData& sigdata, const SigningProvider& provider, std::vector<unsigned char>& sig_out, const CPubKey& pubkey, const CScript& scriptcode, SigVersion sigversion)
261{

Callers 6

DeriveMethod · 0.85
GetPubKeyMethod · 0.85
operator<Method · 0.85
GetPubKeyByXOnlyMethod · 0.85
CPubFromPKHBytesMethod · 0.85
SignStepFunction · 0.85

Calls 4

findMethod · 0.80
endMethod · 0.45
GetPubKeyMethod · 0.45

Tested by

no test coverage detected