Skip to content

Commit

Permalink
Update zetaclient/chains/bitcoin/tx_script.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
bitSmiley and coderabbitai[bot] authored Jul 24, 2024
1 parent 46ceef9 commit 4467e13
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions zetaclient/chains/bitcoin/tx_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,21 +277,18 @@ func DecodeTSSVout(vout btcjson.Vout, receiverExpected string, chain chains.Chai
}

func decodeInscriptionPayload(t *scriptTokenizer) ([]byte, error) {
if !t.Next() || t.Opcode() != txscript.OP_FALSE {
if (!t.Next() || t.Opcode() != txscript.OP_FALSE) {
return nil, fmt.Errorf("OP_FALSE not found")
}

if !t.Next() || t.Opcode() != txscript.OP_IF {
if (!t.Next() || t.Opcode() != txscript.OP_IF) {
return nil, fmt.Errorf("OP_IF not found")
}

memo := make([]byte, 0)
var next byte
for t.Next() {
for t.Next() && t.Opcode() != txscript.OP_ENDIF {
next = t.Opcode()
if next == txscript.OP_ENDIF {
return memo, nil
}
if next < txscript.OP_DATA_1 || next > txscript.OP_PUSHDATA4 {
return nil, fmt.Errorf("expecting data push, found %d", next)
}
Expand Down

0 comments on commit 4467e13

Please sign in to comment.