From b1a7c700483c7b3cc76654a57900c03f80413a48 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 9 Oct 2023 17:00:04 +0200 Subject: [PATCH] tapfreighter: don't send proofs for tombstones Don't attempt to send proofs for tombstone outputs. --- tapfreighter/chain_porter.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tapfreighter/chain_porter.go b/tapfreighter/chain_porter.go index 8583bff30..9c9cf1d0e 100644 --- a/tapfreighter/chain_porter.go +++ b/tapfreighter/chain_porter.go @@ -605,6 +605,18 @@ func (p *ChainPorter) transferReceiverProof(pkg *sendPackage) error { return nil } + unSpendable, err := out.ScriptKey.IsUnSpendable() + if err != nil { + return fmt.Errorf("error checking if script key is "+ + "unspendable: %w", err) + } + if unSpendable { + log.Debugf("Not transferring proof for un-spendable "+ + "output script key %x", + key.SerializeCompressed()) + return nil + } + // We just look for the full proof in the list of final proofs // by matching the content of the proof suffix. var receiverProof *proof.AnnotatedProof