lncfg+lnd: add new dev config unsafeconnect
This flag is added so we can use it in the itest to mimic racing inbound and outbound connections.
This commit is contained in:
3 files changed
+17
-1
No files matched your search
@@ -4988,7 +4988,11 @@ func (s *server) ConnectToPeer(addr *lnwire.NetAddress,
|
||||
|
||||
// Ensure we're not already connected to this peer.
|
||||
peer, err := s.findPeerByPubStr(targetPub)
|
||||
if err == nil {
|
||||
|
||||
// When there's no error it means we already have a connection with this
|
||||
// peer. If this is a dev environment with the `--unsafeconnect` flag
|
||||
// set, we will ignore the existing connection and continue.
|
||||
if err == nil && !s.cfg.Dev.GetUnsafeConnect() {
|
||||
s.mu.Unlock()
|
||||
return &errPeerAlreadyConnected{peer: peer}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user