mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-30 18:43:42 +02:00
peer+server: wait until peer is active to begin channel opening process
Without waiting, we would proceed to retrieve the remote peer's supported features, which may have not been set due to not yet receiving their Init message.
This commit is contained in:
12
server.go
12
server.go
@ -3207,6 +3207,18 @@ func (s *server) OpenChannel(
|
||||
}
|
||||
s.mu.RUnlock()
|
||||
|
||||
// We'll wait until the peer is active before beginning the channel
|
||||
// opening process.
|
||||
select {
|
||||
case <-peer.activeSignal:
|
||||
case <-peer.quit:
|
||||
req.err <- fmt.Errorf("peer %x disconnected", pubKeyBytes)
|
||||
return req.updates, req.err
|
||||
case <-s.quit:
|
||||
req.err <- ErrServerShuttingDown
|
||||
return req.updates, req.err
|
||||
}
|
||||
|
||||
// If the fee rate wasn't specified, then we'll use a default
|
||||
// confirmation target.
|
||||
if req.fundingFeePerKw == 0 {
|
||||
|
Reference in New Issue
Block a user