| 81 | } |
| 82 | |
| 83 | static void ApplyStats(CCoinsStats& stats, const uint256& hash, const std::map<uint32_t, Coin>& outputs) |
| 84 | { |
| 85 | assert(!outputs.empty()); |
| 86 | stats.nTransactions++; |
| 87 | for (auto it = outputs.begin(); it != outputs.end(); ++it) { |
| 88 | stats.nTransactionOutputs++; |
| 89 | if (stats.total_amount.has_value() && it->second.out.nValue.IsExplicit()) { |
| 90 | stats.total_amount = CheckedAdd(*stats.total_amount, it->second.out.nValue.GetAmount()); |
| 91 | } |
| 92 | stats.nBogoSize += GetBogoSize(it->second.out.scriptPubKey); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | //! Calculate statistics about the unspent transaction output set |
| 97 | template <typename T> |
no test coverage detected