Skip to content

Commit

Permalink
tapsend: export TrimSplitWitness helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed May 23, 2024
1 parent 7e4d6db commit 370a717
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tapsend/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ func commitPacket(vPkt *tappsbt.VPacket,
// send. We do the same even for interactive sends to not need
// to distinguish between the two cases in the proof file
// itself.
sendTapCommitment, err = trimSplitWitnesses(sendTapCommitment)
sendTapCommitment, err = TrimSplitWitnesses(sendTapCommitment)
if err != nil {
return fmt.Errorf("error trimming split witnesses: %w",
err)
Expand Down Expand Up @@ -1197,7 +1197,7 @@ func AnchorOutputScript(internalKey *btcec.PublicKey,
// Taproot Asset tree of the input anchor output was built with asset
// leaves that had empty SplitCommitments. We need to replicate this
// here as well.
trimmedCommitment, err := trimSplitWitnesses(anchorCommitment)
trimmedCommitment, err := TrimSplitWitnesses(anchorCommitment)
if err != nil {
return nil, emptyHash, emptyHash, fmt.Errorf("unable to trim "+
"split witnesses: %w", err)
Expand Down Expand Up @@ -1228,9 +1228,9 @@ func AnchorOutputScript(internalKey *btcec.PublicKey,
return script, merkleRoot, taprootAssetRoot, nil
}

// trimSplitWitnesses returns a copy of the commitment in which all assets with
// TrimSplitWitnesses returns a copy of the commitment in which all assets with
// a split commitment witness have their SplitCommitment field set to nil.
func trimSplitWitnesses(
func TrimSplitWitnesses(
c *commitment.TapCommitment) (*commitment.TapCommitment, error) {

// If the input asset was received non-interactively, then the Taproot
Expand Down

0 comments on commit 370a717

Please sign in to comment.