| 246 | // ELEMENTS: |
| 247 | |
| 248 | bool CScript::IsPegoutScript(uint256& genesis_hash, CScript& pegout_scriptpubkey) const |
| 249 | { |
| 250 | const_iterator pc = begin(); |
| 251 | std::vector<unsigned char> data; |
| 252 | opcodetype opcode; |
| 253 | |
| 254 | // OP_RETURN |
| 255 | if (!GetOp(pc, opcode, data) || opcode != OP_RETURN) { |
| 256 | return false; |
| 257 | } |
| 258 | |
| 259 | if (!GetOp(pc, opcode, data) || data.size() != 32 || opcode > OP_PUSHDATA4) { |
| 260 | return false; |
| 261 | } |
| 262 | genesis_hash = uint256(data); |
| 263 | |
| 264 | // Read in parent chain destination scriptpubkey |
| 265 | if (!GetOp(pc, opcode, data) || opcode > OP_PUSHDATA4 ) { |
| 266 | return false; |
| 267 | } |
| 268 | pegout_scriptpubkey = CScript(data.begin(), data.end()); |
| 269 | |
| 270 | // All extra opcodes must be pushes |
| 271 | while(GetOp(pc, opcode, data)) { |
| 272 | if (opcode > OP_PUSHDATA4) { |
| 273 | return false; |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | return true; |
| 278 | } |
| 279 | |
| 280 | bool CScript::IsPegoutScript(const uint256& genesis_hash_check) const |
| 281 | { |
no test coverage detected