lnwallet: make KeyGenMtx public, roc server needs to synchronize
This commit is contained in:
parent
1acc528bda
commit
b3e821c4d2
@ -189,7 +189,7 @@ type addCounterPartySigsMsg struct {
|
|||||||
type LightningWallet struct {
|
type LightningWallet struct {
|
||||||
// This mutex is to be held when generating external keys to be used
|
// This mutex is to be held when generating external keys to be used
|
||||||
// as multi-sig, and commitment keys within the channel.
|
// as multi-sig, and commitment keys within the channel.
|
||||||
keyGenMtx sync.RWMutex
|
KeyGenMtx sync.RWMutex
|
||||||
|
|
||||||
// This mutex MUST be held when performing coin selection in order to
|
// This mutex MUST be held when performing coin selection in order to
|
||||||
// avoid inadvertently creating multiple funding transaction which
|
// avoid inadvertently creating multiple funding transaction which
|
||||||
@ -940,8 +940,8 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs
|
|||||||
// transaction's outputs.
|
// transaction's outputs.
|
||||||
// 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) getNextRawKey() (*btcec.PrivateKey, error) {
|
func (l *LightningWallet) getNextRawKey() (*btcec.PrivateKey, error) {
|
||||||
l.keyGenMtx.Lock()
|
l.KeyGenMtx.Lock()
|
||||||
defer l.keyGenMtx.Unlock()
|
defer l.KeyGenMtx.Unlock()
|
||||||
|
|
||||||
nextAddr, err := l.Manager.NextExternalAddresses(waddrmgr.DefaultAccountNum, 1)
|
nextAddr, err := l.Manager.NextExternalAddresses(waddrmgr.DefaultAccountNum, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user