mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
input+btcwallet: add MuSig2 signing operations
With this commit we add the high-level MuSig2 signing methods to the btcwallet which will later be exposed through an RPC interface.
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
"github.com/btcsuite/btcwallet/walletdb"
|
||||
"github.com/btcsuite/btcwallet/wtxmgr"
|
||||
"github.com/lightningnetwork/lnd/blockcache"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
"github.com/lightningnetwork/lnd/kvdb"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
@@ -98,6 +99,9 @@ type BtcWallet struct {
|
||||
chainKeyScope waddrmgr.KeyScope
|
||||
|
||||
blockCache *blockcache.BlockCache
|
||||
|
||||
musig2Sessions map[input.MuSig2SessionID]*muSig2State
|
||||
musig2SessionsMtx sync.Mutex
|
||||
}
|
||||
|
||||
// A compile time check to ensure that BtcWallet implements the
|
||||
@@ -160,13 +164,14 @@ func New(cfg Config, blockCache *blockcache.BlockCache) (*BtcWallet, error) {
|
||||
}
|
||||
|
||||
return &BtcWallet{
|
||||
cfg: &cfg,
|
||||
wallet: wallet,
|
||||
db: wallet.Database(),
|
||||
chain: cfg.ChainSource,
|
||||
netParams: cfg.NetParams,
|
||||
chainKeyScope: chainKeyScope,
|
||||
blockCache: blockCache,
|
||||
cfg: &cfg,
|
||||
wallet: wallet,
|
||||
db: wallet.Database(),
|
||||
chain: cfg.ChainSource,
|
||||
netParams: cfg.NetParams,
|
||||
chainKeyScope: chainKeyScope,
|
||||
blockCache: blockCache,
|
||||
musig2Sessions: make(map[input.MuSig2SessionID]*muSig2State),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user