mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
connectd: check for re-connected unsaved channels
This commit is contained in:
parent
4c9a4250bf
commit
b9f867b1dd
@ -137,6 +137,9 @@ static struct command_result *json_connect(struct command *cmd,
|
||||
if (peer) {
|
||||
struct channel *channel = peer_active_channel(peer);
|
||||
|
||||
if (!channel)
|
||||
channel = peer_unsaved_channel(peer);
|
||||
|
||||
if (peer->uncommitted_channel
|
||||
|| (channel && channel->connected)) {
|
||||
return connect_cmd_succeed(cmd, peer);
|
||||
|
@ -1323,6 +1323,8 @@ static void json_add_peer(struct lightningd *ld,
|
||||
connected = true;
|
||||
else {
|
||||
channel = peer_active_channel(p);
|
||||
if (!channel)
|
||||
channel = peer_unsaved_channel(p);
|
||||
connected = channel && channel->connected;
|
||||
}
|
||||
json_add_bool(response, "connected", connected);
|
||||
|
@ -549,6 +549,9 @@ void peer_start_openingd(struct peer *peer UNNEEDED,
|
||||
struct per_peer_state *pps UNNEEDED,
|
||||
const u8 *msg UNNEEDED)
|
||||
{ fprintf(stderr, "peer_start_openingd called!\n"); abort(); }
|
||||
/* Generated stub for peer_unsaved_channel */
|
||||
struct channel *peer_unsaved_channel(struct peer *peer UNNEEDED)
|
||||
{ fprintf(stderr, "peer_unsaved_channel called!\n"); abort(); }
|
||||
/* Generated stub for per_peer_state_set_fds */
|
||||
void per_peer_state_set_fds(struct per_peer_state *pps UNNEEDED,
|
||||
int peer_fd UNNEEDED, int gossip_fd UNNEEDED, int gossip_store_fd UNNEEDED)
|
||||
|
Loading…
Reference in New Issue
Block a user