lnwallet: nil single tweak when creating keyring
To make the channel state machine less concerned about the type of commitment, we nil the local tweak when creating the keyring, depending on the commitment type.
This commit is contained in:
2 files changed
+7
-14
No files matched your search
@@ -146,6 +146,13 @@ func DeriveCommitmentKeys(commitPoint *btcec.PublicKey,
|
||||
// we'll use that directly, and ignore the commitPoint tweak.
|
||||
if tweaklessCommit {
|
||||
keyRing.ToRemoteKey = toRemoteBasePoint
|
||||
|
||||
// If this is not our commitment, the above ToRemoteKey will be
|
||||
// ours, and we blank out the local commitment tweak to
|
||||
// indicate that the key should not be tweaked when signing.
|
||||
if !isOurCommit {
|
||||
keyRing.LocalCommitKeyTweak = nil
|
||||
}
|
||||
} else {
|
||||
keyRing.ToRemoteKey = input.TweakPubKey(
|
||||
toRemoteBasePoint, commitPoint,
|
||||
|
||||
Reference in new issue
Block a user