|
@ -1328,30 +1328,20 @@ void route_prune(struct routing_state *rstate) |
|
|
if (!chan->public) |
|
|
if (!chan->public) |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
|
|
|
for (int i = 0; i < 2; i++) { |
|
|
if (chan->connections[0]->last_timestamp < highwater |
|
|
struct node_connection *nc = chan->connections[i]; |
|
|
&& chan->connections[1]->last_timestamp < highwater) { |
|
|
|
|
|
|
|
|
if (!nc) |
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
if (nc->last_timestamp > highwater) { |
|
|
|
|
|
/* Still alive */ |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
status_trace( |
|
|
status_trace( |
|
|
"Pruning channel %s/%d from network view (age %"PRIu64"s)", |
|
|
"Pruning channel %s from network view (ages %"PRIu64" and %"PRIu64"s)", |
|
|
type_to_string(trc, struct short_channel_id, |
|
|
type_to_string(trc, struct short_channel_id, |
|
|
&chan->scid), |
|
|
&chan->scid), |
|
|
nc->flags & 0x1, |
|
|
now - chan->connections[0]->last_timestamp, |
|
|
now - nc->last_timestamp); |
|
|
now - chan->connections[1]->last_timestamp); |
|
|
|
|
|
|
|
|
/* This may free nodes, so do outside loop. */ |
|
|
/* This may perturb iteration so do outside loop. */ |
|
|
tal_steal(pruned, nc); |
|
|
tal_steal(pruned, chan); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* This frees all the node_connections: may free routing_channel and
|
|
|
/* This frees all the routing_channels and maybe even nodes. */ |
|
|
* even nodes. */ |
|
|
|
|
|
tal_free(pruned); |
|
|
tal_free(pruned); |
|
|
} |
|
|
} |
|
|