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:
Johan T. Halseth committed 2020-01-06 12:08:09 +01:00
1 parent 5e3718a1b5
commit f92c7a3af0
2 files changed
+7 -14

No files matched your search

+7
View File
@@ -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,