aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_usage.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/blockchain_utilities/blockchain_usage.cpp b/src/blockchain_utilities/blockchain_usage.cpp
index 7c3c83167..38a0b2648 100644
--- a/src/blockchain_utilities/blockchain_usage.cpp
+++ b/src/blockchain_utilities/blockchain_usage.cpp
@@ -234,7 +234,7 @@ int main(int argc, char* argv[])
}
}
return true;
- });
+ }, true);
std::unordered_map<uint64_t, uint64_t> counts;
size_t total = 0;
@@ -243,10 +243,17 @@ int main(int argc, char* argv[])
counts[out.second.size()]++;
total++;
}
- for (const auto &c: counts)
+ if (total > 0)
+ {
+ for (const auto &c: counts)
+ {
+ float percent = 100.f * c.second / total;
+ MINFO(std::to_string(c.second) << " outputs used " << c.first << " times (" << percent << "%)");
+ }
+ }
+ else
{
- float percent = 100.f * c.second / total;
- MINFO(std::to_string(c.second) << " outputs used " << c.first << " times (" << percent << "%)");
+ MINFO("No outputs to process");
}
LOG_PRINT_L0("Blockchain usage exported OK");