mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 06:21:40 +01:00
lnwallet: update NewLocalForceCloseSummary for local taproot output sweep
This commit is contained in:
parent
ad5305b99c
commit
b72f368673
1 changed files with 18 additions and 0 deletions
|
@ -7240,6 +7240,24 @@ func NewLocalForceCloseSummary(chanState *channeldb.OpenChannel,
|
|||
},
|
||||
MaturityDelay: csvTimeout,
|
||||
}
|
||||
|
||||
// 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,
|
||||
keyRing.RevocationKey, toLocalScript.ScriptTree,
|
||||
)
|
||||
commitResolution.SelfOutputSignDesc.ControlBlock, err = ctrlBlock.ToBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Once the delay output has been found (if it exists), then we'll also
|
||||
|
|
Loading…
Add table
Reference in a new issue