daemon: reconnect with timeout, try from both sides.

This is dumb, since one side will never succeed.  But in future when
there is a method for nodes to broadcast their public address (or send
their address inline to connected nodes), either side should try to
connect.

Importantly though, there are places which will queue packets at
various times (eg. HTLC timeout), so we need to clear the queue just
before re-transmitting, not when disconnecting.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-08-18 14:25:13 +09:30
parent 3866d7605c
commit 795601dfcf
2 changed files with 58 additions and 27 deletions

View File

@@ -91,9 +91,6 @@ struct peer {
/* Network connection. */
struct io_conn *conn;
/* Did we connect to it? (Otherwise, they connected to us) */
bool we_connected;
/* Are we connected now? (Crypto handshake completed). */
bool connected;