lnwallet/channel: reuse derived SingleTweak on local force close
When creating the keyring, the tweak is already calculated in the remote commitment case. We add the calculation also for our own commitment, so we can use it in all cases without deriving the tweak.
This commit is contained in:
2 files changed
+9
-5
No files matched your search
+1
-4
@@ -5436,9 +5436,6 @@ func NewLocalForceCloseSummary(chanState *channeldb.OpenChannel, signer input.Si
|
||||
// nil.
|
||||
var commitResolution *CommitOutputResolution
|
||||
if len(delayScript) != 0 {
|
||||
singleTweak := input.SingleTweakBytes(
|
||||
commitPoint, chanState.LocalChanCfg.DelayBasePoint.PubKey,
|
||||
)
|
||||
localBalance := localCommit.LocalBalance
|
||||
commitResolution = &CommitOutputResolution{
|
||||
SelfOutPoint: wire.OutPoint{
|
||||
@@ -5447,7 +5444,7 @@ func NewLocalForceCloseSummary(chanState *channeldb.OpenChannel, signer input.Si
|
||||
},
|
||||
SelfOutputSignDesc: input.SignDescriptor{
|
||||
KeyDesc: chanState.LocalChanCfg.DelayBasePoint,
|
||||
SingleTweak: singleTweak,
|
||||
SingleTweak: keyRing.LocalCommitKeyTweak,
|
||||
WitnessScript: selfScript,
|
||||
Output: &wire.TxOut{
|
||||
PkScript: delayScript,
|
||||
|
||||
Reference in new issue
Block a user