lnwallet: NewUnilateralCloseSummary for local taproot output sweep

This commit is contained in:
Olaoluwa Osuntokun committed 2023-08-22 16:33:09 -07:00
1 parent b72f368673
commit 52b122a8bb
1 file changed
+20
+20
View File
@@ -6372,6 +6372,26 @@ func NewUnilateralCloseSummary(chanState *channeldb.OpenChannel, signer input.Si
},
MaturityDelay: maturityDelay,
}
// For taproot channels, we'll need to set some additional
// fields to ensure the output can be swept.
//
// TODO(roasbef): abstract into new func
if chanState.ChanType.IsTaproot() {
commitResolution.SelfOutputSignDesc.SignMethod =
input.TaprootScriptSpendSignMethod
ctrlBlock := input.MakeTaprootCtrlBlock(
commitResolution.SelfOutputSignDesc.WitnessScript,
&input.TaprootNUMSKey, selfScript.ScriptTree,
)
commitResolution.SelfOutputSignDesc.ControlBlock, err = ctrlBlock.ToBytes()
if err != nil {
return nil, err
}
// TODO(roasbeef): put ctrl block in resolution?
}
}
closeSummary := channeldb.ChannelCloseSummary{