| 78 | } |
| 79 | |
| 80 | static 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 | |
| 93 | static bool MatchPayToPubkeyHash(const CScript& script, valtype& pubkeyhash) |
| 94 | { |