@@ -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
@@ -1270,6 +1270,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
12701270 nil ,
12711271 breachInfo .LocalOutputSignDesc ,
12721272 breachInfo .BreachHeight ,
1273+ breachInfo .LocalResolutionBlob ,
12731274 )
12741275
12751276 breachedOutputs = append (breachedOutputs , localOutput )
@@ -1296,6 +1297,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
12961297 nil ,
12971298 breachInfo .RemoteOutputSignDesc ,
12981299 breachInfo .BreachHeight ,
1300+ breachInfo .RemoteResolutionBlob ,
12991301 )
13001302
13011303 breachedOutputs = append (breachedOutputs , remoteOutput )
@@ -1330,6 +1332,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
13301332 breachInfo .HtlcRetributions [i ].SecondLevelWitnessScript ,
13311333 & breachInfo .HtlcRetributions [i ].SignDesc ,
13321334 breachInfo .BreachHeight ,
1335+ breachInfo .HtlcRetributions [i ].ResolutionBlob ,
13331336 )
13341337
13351338 // For taproot outputs, we also need to hold onto the second
@@ -1636,12 +1639,28 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
16361639 //nolint:lll
16371640 tapCase .CtrlBlocks .Val .CommitSweepCtrlBlock = bo .signDesc .ControlBlock
16381641
1642+ bo .resolutionBlob .WhenSome (func (blob tlv.Blob ) {
1643+ tapCase .SettledCommitBlob = tlv .SomeRecordT (
1644+ tlv.NewPrimitiveRecord [tlv.TlvType2 ](
1645+ blob ,
1646+ ),
1647+ )
1648+ })
1649+
16391650 // To spend the revoked output again, we'll store the same
16401651 // control block value as above, but in a different place.
16411652 case input .TaprootCommitmentRevoke :
16421653 //nolint:lll
16431654 tapCase .CtrlBlocks .Val .RevokeSweepCtrlBlock = bo .signDesc .ControlBlock
16441655
1656+ bo .resolutionBlob .WhenSome (func (blob tlv.Blob ) {
1657+ tapCase .BreachedCommitBlob = tlv .SomeRecordT (
1658+ tlv.NewPrimitiveRecord [tlv.TlvType3 ](
1659+ blob ,
1660+ ),
1661+ )
1662+ })
1663+
16451664 // For spending the HTLC outputs, we'll store the first and
16461665 // second level tweak values.
16471666 case input .TaprootHtlcAcceptedRevoke :
@@ -1679,12 +1698,24 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
16791698 //nolint:lll
16801699 bo .signDesc .ControlBlock = tapCase .CtrlBlocks .Val .CommitSweepCtrlBlock
16811700
1701+ tapCase .SettledCommitBlob .WhenSomeV (
1702+ func (blob tlv.Blob ) {
1703+ bo .resolutionBlob = fn .Some (blob )
1704+ },
1705+ )
1706+
16821707 // To spend the revoked output again, we'll apply the same
16831708 // control block value as above, but to a different place.
16841709 case input .TaprootCommitmentRevoke :
16851710 //nolint:lll
16861711 bo .signDesc .ControlBlock = tapCase .CtrlBlocks .Val .RevokeSweepCtrlBlock
16871712
1713+ tapCase .BreachedCommitBlob .WhenSomeV (
1714+ func (blob tlv.Blob ) {
1715+ bo .resolutionBlob = fn .Some (blob )
1716+ },
1717+ )
1718+
16881719 // For spending the HTLC outputs, we'll apply the first and
16891720 // second level tweak values.
16901721 case input .TaprootHtlcAcceptedRevoke :
0 commit comments