Skip to content

Commit a3783b0

Browse files
authored
Merge pull request #600 from lightninglabs/fix-burn
tapfreighter: don't attempt to send burns with courier
2 parents 1d5d5c0 + 076320f commit a3783b0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tapfreighter/chain_porter.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,8 @@ func (p *ChainPorter) transferReceiverProof(pkg *sendPackage) error {
606606
return nil
607607
}
608608

609+
// Un-spendable means this is a tombstone output resulting from
610+
// a split.
609611
unSpendable, err := out.ScriptKey.IsUnSpendable()
610612
if err != nil {
611613
return fmt.Errorf("error checking if script key is "+
@@ -618,6 +620,17 @@ func (p *ChainPorter) transferReceiverProof(pkg *sendPackage) error {
618620
return nil
619621
}
620622

623+
// Burns are also always kept local and not sent to any
624+
// receiver.
625+
if len(out.WitnessData) > 0 && asset.IsBurnKey(
626+
out.ScriptKey.PubKey, out.WitnessData[0],
627+
) {
628+
629+
log.Debugf("Not transferring proof for burn script "+
630+
"key %x", key.SerializeCompressed())
631+
return nil
632+
}
633+
621634
// We just look for the full proof in the list of final proofs
622635
// by matching the content of the proof suffix.
623636
var receiverProof *proof.AnnotatedProof

0 commit comments

Comments
 (0)