From 9eda419f9b8f48637645b12a373da195c2d18307 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Thu, 1 Jun 2023 14:21:33 +0200 Subject: [PATCH] Fix 646a7e62: recalc_time was not scaled properly (#10901) This caused "runtime" to underflow or, if you are lucky, hit an assert in ScaleToMonthly when it hits zero. But mostly underflow. --- src/linkgraph/flowmapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkgraph/flowmapper.cpp b/src/linkgraph/flowmapper.cpp index 7ddbafc788..497aacb62b 100644 --- a/src/linkgraph/flowmapper.cpp +++ b/src/linkgraph/flowmapper.cpp @@ -50,7 +50,7 @@ void FlowMapper::Run(LinkGraphJob &job) const /* Scale by time the graph has been running without being compressed. Add 1 to avoid * division by 0 if spawn date == last compression date. This matches * LinkGraph::Monthly(). */ - uint runtime = job.JoinDate() - job.Settings().recalc_time - job.LastCompression() + 1; + uint runtime = job.JoinDate() - job.Settings().recalc_time / SECONDS_PER_DAY - job.LastCompression() + 1; for (auto &it : flows) { it.second.ScaleToMonthly(runtime); }