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:
parent
ab007bb918
commit
98adeb6657
@ -861,6 +861,7 @@ mempoolPoll:
|
|||||||
|
|
||||||
// Now that the channel has been fully swept, it should no longer show
|
// Now that the channel has been fully swept, it should no longer show
|
||||||
// up within the pending channels RPC.
|
// up within the pending channels RPC.
|
||||||
|
time.Sleep(time.Millisecond * 300)
|
||||||
pendingChans, err := net.Alice.PendingChannels(ctxb, pendingChansRequest)
|
pendingChans, err := net.Alice.PendingChannels(ctxb, pendingChansRequest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to query for pending channels: %v", err)
|
t.Fatalf("unable to query for pending channels: %v", err)
|
||||||
|
@ -1140,6 +1140,7 @@ func (s *server) handleConnectPeer(msg *connectPeerMsg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s.pendingConnMtx.Lock()
|
s.pendingConnMtx.Lock()
|
||||||
|
s.persistentPeers[targetPub] = struct{}{}
|
||||||
s.persistentConnReqs[targetPub] = append(s.persistentConnReqs[targetPub],
|
s.persistentConnReqs[targetPub] = append(s.persistentConnReqs[targetPub],
|
||||||
connReq)
|
connReq)
|
||||||
s.pendingConnMtx.Unlock()
|
s.pendingConnMtx.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user