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

Function MatchPayToPubkey

src/script/solver.cpp:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static bool MatchPayToPubkey(const CScript& script, valtype& pubkey)
37{
38 if (script.size() == CPubKey::SIZE + 2 && script[0] == CPubKey::SIZE && script.back() == OP_CHECKSIG) {
39 pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::SIZE + 1);
40 return CPubKey::ValidSize(pubkey);
41 }
42 if (script.size() == CPubKey::COMPRESSED_SIZE + 2 && script[0] == CPubKey::COMPRESSED_SIZE && script.back() == OP_CHECKSIG) {
43 pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::COMPRESSED_SIZE + 1);
44 return CPubKey::ValidSize(pubkey);
45 }
46 return false;
47}
48
49static bool MatchPayToPubkeyHash(const CScript& script, valtype& pubkeyhash)
50{

Callers 1

SolverFunction · 0.85

Calls 3

sizeMethod · 0.45
backMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected