server: properly add user initiated persistent conns to persistentPeers map

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.
This commit is contained in:
Olaoluwa Osuntokun 2017-05-05 15:57:09 -07:00
parent ab007bb918
commit 98adeb6657
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
2 changed files with 2 additions and 0 deletions

View File

@ -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)

View File

@ -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()