Skip to content

Commit

Permalink
fix index-out-of-range
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Oct 14, 2024
1 parent 47956ed commit ee17d0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions submitter/relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ func (rl *Relayer) buildTxWithData(data []byte, firstTx *wire.MsgTx) (*types.Btc
return nil, err
}

if len(rawTxResult.Transaction.TxOut) <= changePosition {
return nil, fmt.Errorf("transaction doesn't have change output %s", rawTxResult.Transaction.TxID())
}

rl.logger.Debugf("Building a BTC tx using %s with data %x", rawTxResult.Transaction.TxID(), data)

_, addresses, _, err := txscript.ExtractPkScriptAddrs(
Expand Down

0 comments on commit ee17d0f

Please sign in to comment.