mit-dci / lit

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

lnp2p should care less about transport layer #430

Open delbonis opened 5 years ago

delbonis commented 5 years ago

We should already verify the pubkey before calling handleNewConnection and it should pass that in as an argument instead of having it there. We should try to isolate stuff interacting with lndc to probably just listen.go and move the "connecting to peers" code to like connect.go.

Really we should just move listening setup code to just pass in an already-ready net.Listener into the lnp2p.NewPeerManager function. Really just do more work to make lnp2p more separated from the rest of the network code.

This would be necessary for having BOLT 8 (transport) and BOLT 1 (messaging) support.

delbonis commented 5 years ago

See #440, that PR is related to this because it's a step towards splitting up connection and session management.

Varunram commented 5 years ago

Depends on how we proceed with implementing BOLT1 and relatives into lit as well, but #440 is a nice start towards the end.