channeld: Send disabling channel_update on shutdown

Sends a disable channel_update before issuing the shutdown message,
gossipd will also take care to update others and not use for future
routes.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2018-01-21 12:01:18 +01:00 committed by Rusty Russell
parent 8aee38162c
commit 6320142c34

View File

@ -716,6 +716,12 @@ static void maybe_send_shutdown(struct peer *peer)
if (!peer->unsent_shutdown_scriptpubkey)
return;
/* Send a disable channel_update so others don't try to route
* over us */
msg = create_channel_update(peer, peer, true);
wire_sync_write(GOSSIP_FD, msg);
enqueue_peer_msg(peer, take(msg));
msg = towire_shutdown(peer, &peer->channel_id,
peer->unsent_shutdown_scriptpubkey);
enqueue_peer_msg(peer, take(msg));