From 9b0af9f046a7b78ed395137d27fc783ca52c217e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 9 Nov 2020 20:03:59 +1030 Subject: [PATCH] gossipd: minor cleanups. Thanks to m-schmook's feedback. Signed-off-by: Rusty Russell --- gossipd/queries.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gossipd/queries.c b/gossipd/queries.c index c6254649e..11c0b462c 100644 --- a/gossipd/queries.c +++ b/gossipd/queries.c @@ -693,12 +693,15 @@ static u8 *append_range_reply(struct peer *peer, u16 i, old_num, added; const struct channel_update_timestamps *ts; /* Zero means "no timestamp" */ - const static struct channel_update_timestamps zero_ts; + const static struct channel_update_timestamps zero_ts = { 0, 0 }; if (timestamps_tlv) { ts = decode_channel_update_timestamps(tmpctx, timestamps_tlv); - if (!ts || tal_count(ts) != tal_count(scids)) { + if (!ts) + return towire_errorfmt(peer, NULL, + "reply_channel_range can't decode timestamps."); + if (tal_count(ts) != tal_count(scids)) { return towire_errorfmt(peer, NULL, "reply_channel_range %zu timestamps when %zu scids?", tal_count(ts),