From 286c526a8167ecc24ca5ebd201bbd9120a640db7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 18 Mar 2021 11:03:35 +1030 Subject: [PATCH] channel: initialize inflight->tx_broadcast (EXPERIMENTAL_FEATURES) valgrind rightfully complains: ``` Valgrind error file: valgrind-errors.182892 ==182892== Conditional jump or move depends on uninitialised value(s) ==182892== at 0x16B381: handle_peer_tx_sigs_sent (dual_open_control.c:1415) ==182892== by 0x16E9F4: dual_opend_msg (dual_open_control.c:2681) ==182892== by 0x165759: sd_msg_read (subd.c:480) ==182892== by 0x1EECCB: next_plan (io.c:59) ==182892== by 0x1EF8B0: do_plan (io.c:407) ==182892== by 0x1EF8F2: io_ready (io.c:417) ==182892== by 0x1F1B8A: io_loop (poll.c:445) ==182892== by 0x131332: io_loop_with_timers (io_loop_with_timers.c:24) ==182892== by 0x13711B: main (lightningd.c:1102) ==182892== -------------------------------------------------------------------------------- ------------------------------- Valgrind errors -------------------------------- Valgrind error file: valgrind-errors.182899 ==182899== Conditional jump or move depends on uninitialised value(s) ==182899== at 0x16C0EE: handle_peer_tx_sigs_msg (dual_open_control.c:1737) ==182899== by 0x16E9D3: dual_opend_msg (dual_open_control.c:2678) ==182899== by 0x165759: sd_msg_read (subd.c:480) ==182899== by 0x1EECCB: next_plan (io.c:59) ==182899== by 0x1EF8B0: do_plan (io.c:407) ==182899== by 0x1EF8F2: io_ready (io.c:417) ==182899== by 0x1F1B8A: io_loop (poll.c:445) ==182899== by 0x131332: io_loop_with_timers (io_loop_with_timers.c:24) ==182899== by 0x13711B: main (lightningd.c:1102) ==182899== ``` Signed-off-by: Rusty Russell --- lightningd/channel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lightningd/channel.c b/lightningd/channel.c index f7779b21c..690bcd49d 100644 --- a/lightningd/channel.c +++ b/lightningd/channel.c @@ -179,6 +179,7 @@ new_inflight(struct channel *channel, inflight->funding_psbt = tal_steal(inflight, psbt); inflight->last_tx = tal_steal(inflight, last_tx); inflight->last_sig = last_sig; + inflight->tx_broadcast = false; list_add_tail(&channel->inflights, &inflight->list); tal_add_destructor(inflight, destroy_inflight);