mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 16:44:20 +01:00
autoclean: Fix a null-pointer derefence when checking HTLC age
The autoclean plugin would assume we have a `resolved_time` which may not be true for oldish nodes that predate our annotations. Changelog-None Unreleased change Reported-by: <@devastgh>
This commit is contained in:
committed by
Rusty Russell
parent
ece77840f9
commit
02f9c2df24
@@ -324,6 +324,14 @@ static struct command_result *listforwards_done(struct command *cmd,
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check if we have a resolved_time, before making a
|
||||
* decision on it. This is possible in older nodes
|
||||
* that predate our annotations for forwards.*/
|
||||
if (json_get_member(buf, t, "resolved_time") == NULL) {
|
||||
cinfo->num_uncleaned++;
|
||||
continue;
|
||||
}
|
||||
|
||||
time = *json_get_member(buf, t, "resolved_time");
|
||||
/* This is a float, so truncate at '.' */
|
||||
for (int off = time.start; off < time.end; off++) {
|
||||
|
||||
Reference in New Issue
Block a user