connectd: do dev_disconnect logic.

As connectd handles more packets itself, or diverts them to/from gossipd,
it's the only place we can implement the dev_disconnect logic.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-01-08 23:55:29 +10:30
parent 9c0bb444b7
commit 7a514112ec
17 changed files with 71 additions and 70 deletions

View File

@@ -208,7 +208,7 @@ struct io_plan *peer_exchange_initmsg(struct io_conn *conn,
next = read_init;
#if DEVELOPER
switch (dev_disconnect(WIRE_INIT)) {
switch (dev_disconnect(&peer->id, WIRE_INIT)) {
case DEV_DISCONNECT_BEFORE:
dev_sabotage_fd(io_conn_fd(conn), true);
break;