Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 877f08a

Browse files
committedMay 14, 2024
tapsend: export TrimSplitWitness helper function
1 parent bba3810 commit 877f08a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎tapsend/send.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ func commitPacket(vPkt *tappsbt.VPacket,
964964
// send. We do the same even for interactive sends to not need
965965
// to distinguish between the two cases in the proof file
966966
// itself.
967-
sendTapCommitment, err = trimSplitWitnesses(sendTapCommitment)
967+
sendTapCommitment, err = TrimSplitWitnesses(sendTapCommitment)
968968
if err != nil {
969969
return fmt.Errorf("error trimming split witnesses: %w",
970970
err)
@@ -1197,7 +1197,7 @@ func AnchorOutputScript(internalKey *btcec.PublicKey,
11971197
// Taproot Asset tree of the input anchor output was built with asset
11981198
// leaves that had empty SplitCommitments. We need to replicate this
11991199
// here as well.
1200-
trimmedCommitment, err := trimSplitWitnesses(anchorCommitment)
1200+
trimmedCommitment, err := TrimSplitWitnesses(anchorCommitment)
12011201
if err != nil {
12021202
return nil, emptyHash, emptyHash, fmt.Errorf("unable to trim "+
12031203
"split witnesses: %w", err)
@@ -1228,9 +1228,9 @@ func AnchorOutputScript(internalKey *btcec.PublicKey,
12281228
return script, merkleRoot, taprootAssetRoot, nil
12291229
}
12301230

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.