mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-18 19:41:21 +02:00
lnwallet+peer: add tapscript root awareness to musig2 sessions
With this commit, the channel is now aware of if it's a musig2 channel, that also has a tapscript root. We'll need to always pass in the tapscript root each time we: make the funding output, sign a new state, and also verify a new state.
This commit is contained in:
committed by
Oliver Gugger
parent
62713c1270
commit
cae4f21897
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2/schnorr/musig2"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
|
||||
@@ -43,10 +44,15 @@ func (m *MusigChanCloser) ProposalClosingOpts() (
|
||||
}
|
||||
|
||||
localKey, remoteKey := m.channel.MultiSigKeys()
|
||||
|
||||
tapscriptTweak := fn.MapOption(lnwallet.TapscriptRootToTweak)(
|
||||
m.channel.State().TapscriptRoot,
|
||||
)
|
||||
|
||||
m.musigSession = lnwallet.NewPartialMusigSession(
|
||||
*m.remoteNonce, localKey, remoteKey,
|
||||
m.channel.Signer, m.channel.FundingTxOut(),
|
||||
lnwallet.RemoteMusigCommit,
|
||||
lnwallet.RemoteMusigCommit, tapscriptTweak,
|
||||
)
|
||||
|
||||
err := m.musigSession.FinalizeSession(*m.localNonce)
|
||||
|
Reference in New Issue
Block a user