MCPcopy Create free account
hub / github.com/ElementsProject/elements / MatchPayToPubkey

Function MatchPayToPubkey

src/script/standard.cpp:80–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static bool MatchPayToPubkey(const CScript& script, valtype& pubkey)
81{
82 if (script.size() == CPubKey::SIZE + 2 && script[0] == CPubKey::SIZE && script.back() == OP_CHECKSIG) {
83 pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::SIZE + 1);
84 return CPubKey::ValidSize(pubkey);
85 }
86 if (script.size() == CPubKey::COMPRESSED_SIZE + 2 && script[0] == CPubKey::COMPRESSED_SIZE && script.back() == OP_CHECKSIG) {
87 pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::COMPRESSED_SIZE + 1);
88 return CPubKey::ValidSize(pubkey);
89 }
90 return false;
91}
92
93static bool MatchPayToPubkeyHash(const CScript& script, valtype& pubkeyhash)
94{

Callers 1

SolverFunction · 0.85

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected