Lnd: Connections made with `connect --perm` are not permanent

Created on 20 Sep 2019  路  1Comment  路  Source: lightningnetwork/lnd

Background

Connections made with connect --perm are not permanent.

Your environment

  • LND v0.7.1-beta
  • Arch Linux
  • bitcoind backend

Expected behaviour

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.

Actual behaviour

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.

P3 bug p2p server

Most helpful comment

@brandoncurtis PR is up!

>All comments

@brandoncurtis PR is up!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexbosworth picture alexbosworth  路  3Comments

sunnya97 picture sunnya97  路  3Comments

alec-djinn picture alec-djinn  路  3Comments

hxsquid picture hxsquid  路  3Comments

joostjager picture joostjager  路  3Comments