lnwallet: fix variable names

This commit is contained in:
Oliver Gugger 2023-01-27 16:13:12 +01:00
parent 0154226233
commit 4f5ede84c6
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

View File

@ -510,14 +510,14 @@ func (b *BtcWallet) MuSig2CreateSession(keyLoc keychain.KeyLocator,
}, },
tweaks.ToContextOptions()..., tweaks.ToContextOptions()...,
) )
musigContext, err := musig2.NewContext(privKey, true, allOpts...) muSigContext, err := musig2.NewContext(privKey, true, allOpts...)
if err != nil { if err != nil {
return nil, fmt.Errorf("error creating MuSig2 signing "+ return nil, fmt.Errorf("error creating MuSig2 signing "+
"context: %v", err) "context: %v", err)
} }
// The session keeps track of the own and other nonces. // The session keeps track of the own and other nonces.
musigSession, err := musigContext.NewSession() muSigSession, err := muSigContext.NewSession()
if err != nil { if err != nil {
return nil, fmt.Errorf("error creating MuSig2 signing "+ return nil, fmt.Errorf("error creating MuSig2 signing "+
"session: %v", err) "session: %v", err)
@ -526,7 +526,7 @@ func (b *BtcWallet) MuSig2CreateSession(keyLoc keychain.KeyLocator,
// Add all nonces we might've learned so far. // Add all nonces we might've learned so far.
haveAllNonces := false haveAllNonces := false
for _, otherSignerNonce := range otherSignerNonces { for _, otherSignerNonce := range otherSignerNonces {
haveAllNonces, err = musigSession.RegisterPubNonce( haveAllNonces, err = muSigSession.RegisterPubNonce(
otherSignerNonce, otherSignerNonce,
) )
if err != nil { if err != nil {
@ -536,28 +536,28 @@ func (b *BtcWallet) MuSig2CreateSession(keyLoc keychain.KeyLocator,
} }
// Register the new session. // Register the new session.
combinedKey, err := musigContext.CombinedKey() combinedKey, err := muSigContext.CombinedKey()
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting combined key: %v", err) return nil, fmt.Errorf("error getting combined key: %v", err)
} }
session := &muSig2State{ session := &muSig2State{
MuSig2SessionInfo: input.MuSig2SessionInfo{ MuSig2SessionInfo: input.MuSig2SessionInfo{
SessionID: input.NewMuSig2SessionID( SessionID: input.NewMuSig2SessionID(
combinedKey, musigSession.PublicNonce(), combinedKey, muSigSession.PublicNonce(),
), ),
PublicNonce: musigSession.PublicNonce(), PublicNonce: muSigSession.PublicNonce(),
CombinedKey: combinedKey, CombinedKey: combinedKey,
TaprootTweak: tweaks.HasTaprootTweak(), TaprootTweak: tweaks.HasTaprootTweak(),
HaveAllNonces: haveAllNonces, HaveAllNonces: haveAllNonces,
}, },
context: musigContext, context: muSigContext,
session: musigSession, session: muSigSession,
} }
// The internal key is only calculated if we are using a taproot tweak // The internal key is only calculated if we are using a taproot tweak
// and need to know it for a potential script spend. // and need to know it for a potential script spend.
if tweaks.HasTaprootTweak() { if tweaks.HasTaprootTweak() {
internalKey, err := musigContext.TaprootInternalKey() internalKey, err := muSigContext.TaprootInternalKey()
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting internal key: %v", return nil, fmt.Errorf("error getting internal key: %v",
err) err)