mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 23:21:12 +02:00
make getNextMultiSigKey concurrent-safe
This commit is contained in:
@@ -612,6 +612,9 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs
|
|||||||
// nextMultiSigKey...
|
// nextMultiSigKey...
|
||||||
// TODO(roasbeef): on shutdown, write state of pending keys, then read back?
|
// TODO(roasbeef): on shutdown, write state of pending keys, then read back?
|
||||||
func (l *LightningWallet) getNextMultiSigKey() (*btcec.PrivateKey, error) {
|
func (l *LightningWallet) getNextMultiSigKey() (*btcec.PrivateKey, error) {
|
||||||
|
l.lmtx.Lock()
|
||||||
|
defer l.lmtx.Unlock()
|
||||||
|
|
||||||
nextAddr, err := l.wallet.Manager.NextExternalAddresses(waddrmgr.DefaultAccountNum, 1)
|
nextAddr, err := l.wallet.Manager.NextExternalAddresses(waddrmgr.DefaultAccountNum, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user