| 29 | } |
| 30 | |
| 31 | bool CScriptCompressor::IsToPubKey(CPubKey& pubkey) const |
| 32 | { |
| 33 | if (script.size() == 35 && script[0] == 33 && script[34] == OP_CHECKSIG && (script[1] == 0x02 || script[1] == 0x03)) { |
| 34 | pubkey.Set(&script[1], &script[34]); |
| 35 | return true; |
| 36 | } |
| 37 | if (script.size() == 67 && script[0] == 65 && script[66] == OP_CHECKSIG && script[1] == 0x04) { |
| 38 | pubkey.Set(&script[1], &script[66]); |
| 39 | return pubkey.IsFullyValid(); // if not fully valid, a case that would not be compressible |
| 40 | } |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | bool CScriptCompressor::Compress(std::vector<unsigned char>& out) const |
| 45 | { |
nothing calls this directly
no test coverage detected