| 38 | } |
| 39 | |
| 40 | static bool IsToPubKey(const CScript& script, CPubKey &pubkey) |
| 41 | { |
| 42 | if (script.size() == 35 && script[0] == 33 && script[34] == OP_CHECKSIG |
| 43 | && (script[1] == 0x02 || script[1] == 0x03)) { |
| 44 | pubkey.Set(&script[1], &script[34]); |
| 45 | return true; |
| 46 | } |
| 47 | if (script.size() == 67 && script[0] == 65 && script[66] == OP_CHECKSIG |
| 48 | && script[1] == 0x04) { |
| 49 | pubkey.Set(&script[1], &script[66]); |
| 50 | return pubkey.IsFullyValid(); // if not fully valid, a case that would not be compressible |
| 51 | } |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | bool CompressScript(const CScript& script, CompressedScript& out) |
| 56 | { |
no test coverage detected