Skip to content

Commit

Permalink
gossipd: fix inverted test in debug print.
Browse files Browse the repository at this point in the history
==1503== Use of uninitialised value of size 8
==1503==    at 0x566786B: _itoa_word (_itoa.c:179)
==1503==    by 0x566AF0D: vfprintf (vfprintf.c:1642)
==1503==    by 0x569790F: vsnprintf (vsnprintf.c:114)
==1503==    by 0x156CCB: do_vfmt (str.c:66)
==1503==    by 0x156DB1: tal_vfmt_ (str.c:92)
==1503==    by 0x1289CD: status_vfmt (status.c:141)
==1503==    by 0x128AAC: status_fmt (status.c:151)
==1503==    by 0x118E05: route_prune (routing.c:2495)
==1503==    by 0x11DE2D: gossip_refresh_network (gossipd.c:1997)
==1503==    by 0x1292B8: timer_expired (timeout.c:39)
==1503==    by 0x12088C: main (gossipd.c:3075)

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and niftynei committed Jul 18, 2019
1 parent 7984a55 commit b3215a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gossipd/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -2496,10 +2496,10 @@ void route_prune(struct routing_state *rstate)
"Pruning channel %s from network view (ages %"PRIu64" and %"PRIu64"s)",
type_to_string(tmpctx, struct short_channel_id,
&chan->scid),
is_halfchan_defined(&chan->half[0]) ? 0
: now - chan->half[0].bcast.timestamp,
is_halfchan_defined(&chan->half[1]) ? 0
: now - chan->half[1].bcast.timestamp);
is_halfchan_defined(&chan->half[0])
? now - chan->half[0].bcast.timestamp : 0,
is_halfchan_defined(&chan->half[1])
? now - chan->half[1].bcast.timestamp : 0);

/* This may perturb iteration so do outside loop. */
tal_arr_expand(&pruned, chan);
Expand Down

0 comments on commit b3215a8

Please sign in to comment.