@@ -1078,10 +1078,9 @@ type breachedOutput struct {
10781078// makeBreachedOutput assembles a new breachedOutput that can be used by the
10791079// breach arbiter to construct a justice or sweep transaction.
10801080func makeBreachedOutput (outpoint * wire.OutPoint ,
1081- witnessType input.StandardWitnessType ,
1082- secondLevelScript []byte ,
1083- signDescriptor * input.SignDescriptor ,
1084- confHeight uint32 ) breachedOutput {
1081+ witnessType input.StandardWitnessType , secondLevelScript []byte ,
1082+ signDescriptor * input.SignDescriptor , confHeight uint32 ,
1083+ resolutionBlob fn.Option [tlv.Blob ]) breachedOutput {
10851084
10861085 amount := signDescriptor .Output .Value
10871086
@@ -1092,6 +1091,7 @@ func makeBreachedOutput(outpoint *wire.OutPoint,
10921091 witnessType : witnessType ,
10931092 signDesc : * signDescriptor ,
10941093 confHeight : confHeight ,
1094+ resolutionBlob : resolutionBlob ,
10951095 }
10961096}
10971097
@@ -1269,6 +1269,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
12691269 nil ,
12701270 breachInfo .LocalOutputSignDesc ,
12711271 breachInfo .BreachHeight ,
1272+ breachInfo .LocalResolutionBlob ,
12721273 )
12731274
12741275 breachedOutputs = append (breachedOutputs , localOutput )
@@ -1295,6 +1296,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
12951296 nil ,
12961297 breachInfo .RemoteOutputSignDesc ,
12971298 breachInfo .BreachHeight ,
1299+ breachInfo .RemoteResolutionBlob ,
12981300 )
12991301
13001302 breachedOutputs = append (breachedOutputs , remoteOutput )
@@ -1329,6 +1331,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
13291331 breachInfo .HtlcRetributions [i ].SecondLevelWitnessScript ,
13301332 & breachInfo .HtlcRetributions [i ].SignDesc ,
13311333 breachInfo .BreachHeight ,
1334+ breachInfo .HtlcRetributions [i ].ResolutionBlob ,
13321335 )
13331336
13341337 // For taproot outputs, we also need to hold onto the second
@@ -1635,12 +1638,28 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
16351638 //nolint:lll
16361639 tapCase .CtrlBlocks .Val .CommitSweepCtrlBlock = bo .signDesc .ControlBlock
16371640
1641+ bo .resolutionBlob .WhenSome (func (blob tlv.Blob ) {
1642+ tapCase .SettledCommitBlob = tlv .SomeRecordT (
1643+ tlv.NewPrimitiveRecord [tlv.TlvType2 ](
1644+ blob ,
1645+ ),
1646+ )
1647+ })
1648+
16381649 // To spend the revoked output again, we'll store the same
16391650 // control block value as above, but in a different place.
16401651 case input .TaprootCommitmentRevoke :
16411652 //nolint:lll
16421653 tapCase .CtrlBlocks .Val .RevokeSweepCtrlBlock = bo .signDesc .ControlBlock
16431654
1655+ bo .resolutionBlob .WhenSome (func (blob tlv.Blob ) {
1656+ tapCase .BreachedCommitBlob = tlv .SomeRecordT (
1657+ tlv.NewPrimitiveRecord [tlv.TlvType3 ](
1658+ blob ,
1659+ ),
1660+ )
1661+ })
1662+
16441663 // For spending the HTLC outputs, we'll store the first and
16451664 // second level tweak values.
16461665 case input .TaprootHtlcAcceptedRevoke :
@@ -1678,12 +1697,22 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
16781697 //nolint:lll
16791698 bo .signDesc .ControlBlock = tapCase .CtrlBlocks .Val .CommitSweepCtrlBlock
16801699
1700+ tapCase .SettledCommitBlob .WhenSomeV (func (blob tlv.Blob ) { //nolint:lll
1701+ bo .resolutionBlob = fn .Some (blob )
1702+ })
1703+
16811704 // To spend the revoked output again, we'll apply the same
16821705 // control block value as above, but to a different place.
16831706 case input .TaprootCommitmentRevoke :
16841707 //nolint:lll
16851708 bo .signDesc .ControlBlock = tapCase .CtrlBlocks .Val .RevokeSweepCtrlBlock
16861709
1710+ tapCase .BreachedCommitBlob .WhenSomeV (
1711+ func (blob tlv.Blob ) {
1712+ bo .resolutionBlob = fn .Some (blob )
1713+ },
1714+ )
1715+
16871716 // For spending the HTLC outputs, we'll apply the first and
16881717 // second level tweak values.
16891718 case input .TaprootHtlcAcceptedRevoke :
0 commit comments