mit-dci / lit

Lightning Network node software
MIT License
551 stars 119 forks source link

Autoreconnect only to those peers attached to running coin daemon(s) #293

Closed Varunram closed 6 years ago

Varunram commented 6 years ago

291

gertjaap commented 6 years ago

This will only reconnect peers that you have or had a channel with. The functionality used to reconnect to peers that you know, and previously connected to. For nodes you're settling a previous agreed DLC with this would mean going back to manual reconnection when settling.

I don't see the problem of being reconnected to a peer that has/had a channel with you in a coin type you are currently not connected to a daemon for. If that is a problem, we should also disallow manual connection to such a peer.

So i don't think this is a good addition to merge in.

Varunram commented 6 years ago

I think we can make it work with DLCs as well, haven't looked into that.

I don't see the problem of being reconnected to a peer that has/had a channel with you in a coin type you are currently not connected to a daemon for

You can't push funds and you can't create channels, so I don't see any reason why you should except for the fact that you can receive money, which imo should be spun off into a listen only mode, where you can listen for incoming connections and channels, but can't push funds or do operations from your side.

gertjaap commented 6 years ago

Discussed during the meeting: make this new logic optional under a switch

gertjaap commented 6 years ago

Made the changes as per discussion (optional through lit.conf or command line switch option). Code will skip reconnecting if the peer does not meet the requirement of having a channel in one of the connected coin types.