From 3372645d8e9ee6c9448f23b305c96c49b8eeb98e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 9 Nov 2016 20:01:59 +1030 Subject: [PATCH] peer_disconnect: simply free if in STATE_INIT. db_forget_peer() was harmless, but we haven't been entered into the database yet anyway, and it asserted that we should have been STATE_CLOSED. Closes: #67 Signed-off-by: Rusty Russell --- daemon/peer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/daemon/peer.c b/daemon/peer.c index 2a54ae6fb..5795f6cf7 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -2603,9 +2603,7 @@ static void peer_disconnect(struct io_conn *conn, struct peer *peer) /* Not even set up yet? Simply free.*/ if (peer->state == STATE_INIT) { - /* FIXME: Make reconnect work for STATE_INIT, but - * cleanup if we don't reconnect after some duration. */ - db_forget_peer(peer); + /* This means we didn't get past crypto handshake or hit db */ tal_free(peer); return; }