mirror of
https://github.com/monero-project/monero.git
synced 2024-12-14 12:26:31 +02:00
blockchain_usage: don't divide by 0 when there is nothing to process
Coverity 184942
This commit is contained in:
parent
8361d60aef
commit
6fc97c97eb
@ -243,10 +243,17 @@ int main(int argc, char* argv[])
|
|||||||
counts[out.second.size()]++;
|
counts[out.second.size()]++;
|
||||||
total++;
|
total++;
|
||||||
}
|
}
|
||||||
for (const auto &c: counts)
|
if (total > 0)
|
||||||
{
|
{
|
||||||
float percent = 100.f * c.second / total;
|
for (const auto &c: counts)
|
||||||
MINFO(std::to_string(c.second) << " outputs used " << c.first << " times (" << percent << "%)");
|
{
|
||||||
|
float percent = 100.f * c.second / total;
|
||||||
|
MINFO(std::to_string(c.second) << " outputs used " << c.first << " times (" << percent << "%)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MINFO("No outputs to process");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_PRINT_L0("Blockchain usage exported OK");
|
LOG_PRINT_L0("Blockchain usage exported OK");
|
||||||
|
Loading…
Reference in New Issue
Block a user