Skip to content

Commit

Permalink
update leaves in htlc
Browse files Browse the repository at this point in the history
  • Loading branch information
Revantark committed Oct 3, 2024
1 parent 762aac3 commit 57b0fed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion btc/htlc.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ func htlcLeaves(htlc *HTLC) (*htlcTapLeaves, error) {
if err != nil {
return &htlcTapLeaves{}, err
}

refundLeaf, err := RefundLeaf(htlc.InitiatorPubkey, htlc.Timelock)
if err != nil {
return &htlcTapLeaves{}, err
Expand Down Expand Up @@ -513,7 +514,7 @@ func newLeaves(redeem, refund, instantRefund txscript.TapLeaf) (*htlcTapLeaves,
}

func (l *htlcTapLeaves) ToArray() []txscript.TapLeaf {
return []txscript.TapLeaf{l.redeem, l.refund, l.instantRefund}
return []txscript.TapLeaf{l.instantRefund, l.refund, l.redeem}
}

func getControlBlock(internalKey *btcec.PublicKey, htlc *HTLC, leaf Leaf) (txscript.TapLeaf, []byte, error) {
Expand Down

0 comments on commit 57b0fed

Please sign in to comment.