mit-dci / lit

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

Made some changes to peer init in lnp2p #429

Closed delbonis closed 5 years ago

delbonis commented 5 years ago

This unifies the setup we do after we've established the connection. I moved the peer init code from the functions for connecting to peers and for listening for new connections to another function so new connections get the same treatment regardless of how it was created.

I also did some changes to the NetSettings struct, it's passed to the peermgr on creation, so we don't have to provide it every time we connect to a peer. Plus some other minor fixes there.

I also added a lncore.ParseLnAddr function that takes a string, verifies that it conforms to what we expect for a lit address, and returns it as a LnAddr or returns an error describing why it isn't valid. I also replaced all of the direct casts to lncore.LnAddr across lit to calls to that function. There's also a .ToString() function on it but there's not much interesting about that.

Varunram commented 5 years ago

Also, would be nice if you could create a new label named "In Progress" to tag it so :)