connect: succeed if we connect to peer and it *doesn't* go back to gossipd.

The JSON connect command wouldn't terminate if peer reconnected
in a state CHANNELD_AWAITING_LOCKIN or above.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-01-25 20:44:21 +10:30 committed by Christian Decker
parent b91556283b
commit c42fa4404a

View File

@ -547,7 +547,7 @@ void peer_connected(struct lightningd *ld, const u8 *msg,
peer_start_channeld(peer, &cs, gossip_index,
peer_fd, gossip_fd, NULL,
true);
return;
goto connected;
case CLOSINGD_SIGEXCHANGE:
case CLOSINGD_COMPLETE:
@ -559,7 +559,7 @@ void peer_connected(struct lightningd *ld, const u8 *msg,
peer_start_closingd(peer, &cs, gossip_index,
peer_fd, gossip_fd,
true);
return;
goto connected;
}
abort();
}
@ -571,6 +571,7 @@ return_to_gossipd:
subd_send_fd(ld->gossip, peer_fd);
subd_send_fd(ld->gossip, gossip_fd);
connected:
/* If we were waiting for connection, we succeeded. */
connect_succeeded(ld, &id);
return;