MCPcopy Create free account
hub / github.com/ElementsProject/elements / ApplyStats

Function ApplyStats

src/node/coinstats.cpp:83–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83static 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
97template <typename T>

Callers 1

GetUTXOStatsFunction · 0.85

Calls 7

CheckedAddFunction · 0.85
GetBogoSizeFunction · 0.85
IsExplicitMethod · 0.80
GetAmountMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected