Open delbonis opened 5 years ago
See #440, that PR is related to this because it's a step towards splitting up connection and session management.
Depends on how we proceed with implementing BOLT1 and relatives into lit as well, but #440 is a nice start towards the end.
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 withlndc
to probably justlisten.go
and move the "connecting to peers" code to likeconnect.go
.Really we should just move listening setup code to just pass in an already-ready
net.Listener
into thelnp2p.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.