mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-14 10:29:29 +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
c8b7987a39
commit
82ba5bf0bf
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
@@ -178,8 +179,9 @@ func (m *mockChannel) RemoteUpfrontShutdownScript() lnwire.DeliveryAddress {
|
||||
}
|
||||
|
||||
func (m *mockChannel) CreateCloseProposal(fee btcutil.Amount,
|
||||
localScript, remoteScript []byte, _ ...lnwallet.ChanCloseOpt,
|
||||
) (input.Signature, *chainhash.Hash, btcutil.Amount, error) {
|
||||
localScript, remoteScript []byte,
|
||||
_ ...lnwallet.ChanCloseOpt) (input.Signature, *chainhash.Hash,
|
||||
btcutil.Amount, error) {
|
||||
|
||||
if m.chanType.IsTaproot() {
|
||||
return lnwallet.NewMusigPartialSig(
|
||||
@@ -188,6 +190,7 @@ func (m *mockChannel) CreateCloseProposal(fee btcutil.Amount,
|
||||
R: new(btcec.PublicKey),
|
||||
},
|
||||
lnwire.Musig2Nonce{}, lnwire.Musig2Nonce{}, nil,
|
||||
fn.None[chainhash.Hash](),
|
||||
), nil, 0, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user