Skip to content

Commit

Permalink
Make CreateOpReturnOutput public
Browse files Browse the repository at this point in the history
  • Loading branch information
ordishs committed Dec 6, 2022
1 parent 725ac9c commit d167434
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions txoutput.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (tx *Tx) AddHashPuzzleOutput(secret, publicKeyHash string, satoshis uint64)
// AddOpReturnOutput creates a new Output with OP_FALSE OP_RETURN and then the data
// passed in encoded as hex.
func (tx *Tx) AddOpReturnOutput(data []byte) error {
o, err := createOpReturnOutput([][]byte{data})
o, err := CreateOpReturnOutput([][]byte{data})
if err != nil {
return err
}
Expand All @@ -170,15 +170,15 @@ func (tx *Tx) AddOpReturnOutput(data []byte) error {
// AddOpReturnPartsOutput creates a new Output with OP_FALSE OP_RETURN and then
// uses OP_PUSHDATA format to encode the multiple byte arrays passed in.
func (tx *Tx) AddOpReturnPartsOutput(data [][]byte) error {
o, err := createOpReturnOutput(data)
o, err := CreateOpReturnOutput(data)
if err != nil {
return err
}
tx.AddOutput(o)
return nil
}

func createOpReturnOutput(data [][]byte) (*Output, error) {
func CreateOpReturnOutput(data [][]byte) (*Output, error) {
s := &bscript.Script{}

_ = s.AppendOpcodes(bscript.OpFALSE, bscript.OpRETURN)
Expand Down

0 comments on commit d167434

Please sign in to comment.