Connections made with connect --perm are not permanent.
I would expect my node to stay connected to a node that I connect to with --perm even if I don't have channels open with it. This would fit the description of the command:
lncli connect --perm If set, the daemon will attempt to persistently connect to the target peer.
where XYZ@XYZ:XYZ is the address of a node that you do not have a channel with:
lncli connect --perm XYZ@XYZ:XYZ
Then watch the logs to see that this channel is rapidly removed:
2019-08-09 12:01:49.084 [INF] SRVR: Established connection to: XYZ@XYZ:XYZ
2019-08-09 12:01:49.085 [INF] SRVR: Finalizing connection to XYZ@XYZ:XYZ inbound=false
2019-08-09 12:01:49.606 [INF] SRVR: Pruning peer XYZ from persistent connections, number of open channels is now zero
2019-08-09 12:01:49.606 [INF] SRVR: Negotiated chan series queries with XYZ
2019-08-09 12:01:49.606 [INF] DISC: Creating new GossipSyncer for peer=XYZ
the behavior of prunePersistentPeerConnection needs to be updated to avoid pruning connections to peers that were opened with --perm:
https://github.com/lightningnetwork/lnd/blob/701244012a1c5a795cdfa7c1a925a775149de4c2/peer.go#L352-L354
@cfromknecht and I have talked about this a bit on the LND Slack.
@brandoncurtis PR is up!
Most helpful comment
@brandoncurtis PR is up!