| 34 | } |
| 35 | |
| 36 | static 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 | |
| 49 | static bool MatchPayToPubkeyHash(const CScript& script, valtype& pubkeyhash) |
| 50 | { |