mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-10 07:18:45 +02:00
funding: add missing mutex around activeReservations
This commit is contained in:
@@ -835,12 +835,15 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) {
|
|||||||
|
|
||||||
// TODO(roasbeef): modify to only accept a _single_ pending channel per
|
// TODO(roasbeef): modify to only accept a _single_ pending channel per
|
||||||
// block unless white listed
|
// block unless white listed
|
||||||
|
f.resMtx.RLock()
|
||||||
if len(f.activeReservations[peerIDKey]) >= cfg.MaxPendingChannels {
|
if len(f.activeReservations[peerIDKey]) >= cfg.MaxPendingChannels {
|
||||||
|
f.resMtx.RUnlock()
|
||||||
f.failFundingFlow(
|
f.failFundingFlow(
|
||||||
fmsg.peerAddress.IdentityKey, fmsg.msg.PendingChannelID,
|
fmsg.peerAddress.IdentityKey, fmsg.msg.PendingChannelID,
|
||||||
lnwire.ErrMaxPendingChannels)
|
lnwire.ErrMaxPendingChannels)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
f.resMtx.RUnlock()
|
||||||
|
|
||||||
// We'll also reject any requests to create channels until we're fully
|
// We'll also reject any requests to create channels until we're fully
|
||||||
// synced to the network as we won't be able to properly validate the
|
// synced to the network as we won't be able to properly validate the
|
||||||
|
Reference in New Issue
Block a user