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

Function MatchPayToPubkey

src/script/standard.cpp:44–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44static bool MatchPayToPubkey(const CScript& script, valtype& pubkey)
45{
46 if (script.size() == CPubKey::PUBLIC_KEY_SIZE + 2 && script[0] == CPubKey::PUBLIC_KEY_SIZE && script.back() == OP_CHECKSIG) {
47 pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::PUBLIC_KEY_SIZE + 1);
48 return CPubKey::ValidSize(pubkey);
49 }
50 if (script.size() == CPubKey::COMPRESSED_PUBLIC_KEY_SIZE + 2 && script[0] == CPubKey::COMPRESSED_PUBLIC_KEY_SIZE && script.back() == OP_CHECKSIG) {
51 pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::COMPRESSED_PUBLIC_KEY_SIZE + 1);
52 return CPubKey::ValidSize(pubkey);
53 }
54 return false;
55}
56
57static bool MatchPayToPubkeyHash(const CScript& script, valtype& pubkeyhash)
58{

Callers 1

SolverFunction · 0.85

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected