ScriptHasOpSuccess returns true if any op codes in the script contain an OP_SUCCESS op code.
(witnessScript []byte)
| 549 | // ScriptHasOpSuccess returns true if any op codes in the script contain an |
| 550 | // OP_SUCCESS op code. |
| 551 | func ScriptHasOpSuccess(witnessScript []byte) bool { |
| 552 | // First, create a new script tokenizer so we can run through all the |
| 553 | // elements. |
| 554 | tokenizer := MakeScriptTokenizer(0, witnessScript) |
| 555 | |
| 556 | // Run through all the op codes, returning true if we find anything |
| 557 | // that is marked as a new op success. |
| 558 | for tokenizer.Next() { |
| 559 | if _, ok := successOpcodes[tokenizer.Opcode()]; ok { |
| 560 | return true |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | return false |
| 565 | } |
no test coverage detected
searching dependent graphs…