lnwallet: fix taproot co-op close nonce bug

The local nonce needs to be the one that's finalized to simulate us
receiving the remote nonce, then generating the local nonce in a JIT
style.
This commit is contained in:
Olaoluwa Osuntokun 2023-08-08 20:20:49 -07:00
parent 93e8428b6b
commit bed9455d60
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

View File

@ -44,12 +44,12 @@ func (m *MusigChanCloser) ProposalClosingOpts() (
localKey, remoteKey := m.channel.MultiSigKeys()
m.musigSession = lnwallet.NewPartialMusigSession(
*m.localNonce, localKey, remoteKey,
*m.remoteNonce, localKey, remoteKey,
m.channel.Signer, m.channel.FundingTxOut(),
lnwallet.RemoteMusigCommit,
)
err := m.musigSession.FinalizeSession(*m.remoteNonce)
err := m.musigSession.FinalizeSession(*m.localNonce)
if err != nil {
return nil, err
}