Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 875 Lines • ▼ Show 20 Lines | static void ApplyStats(CCoinsStats &stats, CHashWriter &ss, const uint256 &hash, | ||||
ss << VARINT(outputs.begin()->second.GetHeight() * 2 + | ss << VARINT(outputs.begin()->second.GetHeight() * 2 + | ||||
outputs.begin()->second.IsCoinBase()); | outputs.begin()->second.IsCoinBase()); | ||||
stats.nTransactions++; | stats.nTransactions++; | ||||
for (const auto output : outputs) { | for (const auto output : outputs) { | ||||
ss << VARINT(output.first + 1); | ss << VARINT(output.first + 1); | ||||
ss << *(const CScriptBase *)(&output.second.GetTxOut().scriptPubKey); | ss << *(const CScriptBase *)(&output.second.GetTxOut().scriptPubKey); | ||||
ss << VARINT(output.second.GetTxOut().nValue.GetSatoshis()); | ss << VARINT(output.second.GetTxOut().nValue.GetSatoshis()); | ||||
stats.nTransactionOutputs++; | stats.nTransactionOutputs++; | ||||
stats.nTotalAmount += output.second.GetTxOut().nValue.GetSatoshis(); | stats.nTotalAmount += output.second.GetTxOut().nValue; | ||||
stats.nBogoSize += | stats.nBogoSize += | ||||
32 /* txid */ + 4 /* vout index */ + 4 /* height + coinbase */ + | 32 /* txid */ + 4 /* vout index */ + 4 /* height + coinbase */ + | ||||
8 /* amount */ + 2 /* scriptPubKey len */ + | 8 /* amount */ + 2 /* scriptPubKey len */ + | ||||
output.second.GetTxOut().scriptPubKey.size() /* scriptPubKey */; | output.second.GetTxOut().scriptPubKey.size() /* scriptPubKey */; | ||||
} | } | ||||
ss << VARINT(0); | ss << VARINT(0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 774 Lines • Show Last 20 Lines |