From bed9455d608a150361206c782bbd2aab1350020d Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 8 Aug 2023 20:20:49 -0700 Subject: [PATCH] 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. --- peer/musig_chan_closer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peer/musig_chan_closer.go b/peer/musig_chan_closer.go index 3e9b65497..6b05b1e62 100644 --- a/peer/musig_chan_closer.go +++ b/peer/musig_chan_closer.go @@ -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 }