gossipd: have master explicitly tell us when peer is disconnected.

Currently we intuit it from the fd being closed, but that may happen out
of order with when the master thinks it's dead.

So now if the gossip fd closes we just ignore it, and we'll get a
notification from the master when the peer is disconnected.

The notification is slightly ugly in that we have to disable it for
a channel when we manually hand the channel back to gossipd.

Note: as stands, this is racy with reconnects.  See the next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-04-26 14:21:01 +09:30
parent 1e282ecb7a
commit be1f33b265
9 changed files with 76 additions and 21 deletions

View File

@@ -366,6 +366,9 @@ void channel_errmsg(struct channel *channel,
err_for_them,
tal_len(err_for_them), 0);
/* Make sure channel_fail_permanent doesn't tell gossipd we died! */
channel->connected = false;
/* BOLT #1:
*
* A sending node: