From 98adeb665775069edc5596df40018c123dacbad0 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 5 May 2017 15:57:09 -0700 Subject: [PATCH] server: properly add user initiated persistent conns to persistentPeers map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a prior bug wherein if a user connected to a peer using the —perm command, then once the peer was disconnected, we wouldn’t automatically connect to them. --- lnd_test.go | 1 + server.go | 1 + 2 files changed, 2 insertions(+) diff --git a/lnd_test.go b/lnd_test.go index 901b7a5d..1e3d6dcc 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -861,6 +861,7 @@ mempoolPoll: // Now that the channel has been fully swept, it should no longer show // up within the pending channels RPC. + time.Sleep(time.Millisecond * 300) pendingChans, err := net.Alice.PendingChannels(ctxb, pendingChansRequest) if err != nil { t.Fatalf("unable to query for pending channels: %v", err) diff --git a/server.go b/server.go index 9c1679df..029937a1 100644 --- a/server.go +++ b/server.go @@ -1140,6 +1140,7 @@ func (s *server) handleConnectPeer(msg *connectPeerMsg) { } s.pendingConnMtx.Lock() + s.persistentPeers[targetPub] = struct{}{} s.persistentConnReqs[targetPub] = append(s.persistentConnReqs[targetPub], connReq) s.pendingConnMtx.Unlock()