Skip to content

Commit 8f190c6

Browse files
committed
channel: don't send disable update to gossipd if we haven't announced channel yet.
Valgrind error file: /tmp/lightning-8k06jbb3/test_disconnect/lightning-7/valgrind-errors ==32307== Uninitialised byte(s) found during client check request ==32307== at 0x11EBAD: memcheck_ (mem.h:247) ==32307== by 0x11EC18: towire (towire.c:14) ==32307== by 0x11EF19: towire_short_channel_id (towire.c:92) ==32307== by 0x12203E: towire_channel_update (gen_peer_wire.c:918) ==32307== by 0x1148D4: send_channel_update (channel.c:185) ==32307== by 0x1175C5: peer_conn_broken (channel.c:1010) ==32307== by 0x13186F: destroy_conn (poll.c:173) ==32307== by 0x13188F: destroy_conn_close_fd (poll.c:179) ==32307== by 0x13B279: notify (tal.c:235) ==32307== by 0x13B721: del_tree (tal.c:395) ==32307== by 0x13BB3A: tal_free (tal.c:504) ==32307== by 0x130522: io_close (io.c:415) ==32307== Address 0xffefff87d is on thread 1's stack ==32307== in frame #2, created by towire_short_channel_id (towire.c:88) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 302ed0c commit 8f190c6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lightningd/channel/channel.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,13 @@ static struct io_plan *setup_peer_conn(struct io_conn *conn, struct peer *peer)
10071007

10081008
static void peer_conn_broken(struct io_conn *conn, struct peer *peer)
10091009
{
1010-
send_channel_update(peer, true);
1011-
/* Make sure gossipd actually gets this message before dying */
1012-
daemon_conn_sync_flush(&peer->gossip_client);
1010+
/* If we have signatures, send an update to say we're disabled. */
1011+
if (peer->have_sigs[LOCAL] && peer->have_sigs[REMOTE]) {
1012+
send_channel_update(peer, true);
1013+
1014+
/* Make sure gossipd actually gets this message before dying */
1015+
daemon_conn_sync_flush(&peer->gossip_client);
1016+
}
10131017
status_failed(WIRE_CHANNEL_PEER_READ_FAILED,
10141018
"peer connection broken: %s", strerror(errno));
10151019
}

0 commit comments

Comments
 (0)