6 #ifndef RAVEN_CORE_MEMUSAGE_H 7 #define RAVEN_CORE_MEMUSAGE_H 13 static inline size_t RecursiveDynamicUsage(
const CScript& script) {
14 return memusage::DynamicUsage(script);
17 static inline size_t RecursiveDynamicUsage(
const COutPoint& out) {
21 static inline size_t RecursiveDynamicUsage(
const CTxIn& in) {
24 mem += memusage::DynamicUsage(*it);
29 static inline size_t RecursiveDynamicUsage(
const CTxOut& out) {
33 static inline size_t RecursiveDynamicUsage(
const CTransaction& tx) {
34 size_t mem = memusage::DynamicUsage(tx.
vin) + memusage::DynamicUsage(tx.
vout);
35 for (std::vector<CTxIn>::const_iterator it = tx.
vin.begin(); it != tx.
vin.end(); it++) {
36 mem += RecursiveDynamicUsage(*it);
38 for (std::vector<CTxOut>::const_iterator it = tx.
vout.begin(); it != tx.
vout.end(); it++) {
39 mem += RecursiveDynamicUsage(*it);
45 size_t mem = memusage::DynamicUsage(tx.
vin) + memusage::DynamicUsage(tx.
vout);
46 for (std::vector<CTxIn>::const_iterator it = tx.
vin.begin(); it != tx.
vin.end(); it++) {
47 mem += RecursiveDynamicUsage(*it);
49 for (std::vector<CTxOut>::const_iterator it = tx.
vout.begin(); it != tx.
vout.end(); it++) {
50 mem += RecursiveDynamicUsage(*it);
55 static inline size_t RecursiveDynamicUsage(
const CBlock& block) {
56 size_t mem = memusage::DynamicUsage(block.
vtx);
57 for (
const auto& tx : block.
vtx) {
58 mem += memusage::DynamicUsage(tx) + RecursiveDynamicUsage(*tx);
63 static inline size_t RecursiveDynamicUsage(
const CBlockLocator& locator) {
64 return memusage::DynamicUsage(locator.
vHave);
68 static inline size_t RecursiveDynamicUsage(
const std::shared_ptr<X>& p) {
69 return p ? memusage::DynamicUsage(p) + RecursiveDynamicUsage(*p) : 0;
72 #endif // RAVEN_CORE_MEMUSAGE_H Describes a place in the block chain to another node such that if the other node doesn't have the sam...
CScriptWitness scriptWitness
std::vector< std::vector< unsigned char > > stack
const std::vector< CTxIn > vin
An input of a transaction.
const std::vector< CTxOut > vout
An output of a transaction.
std::vector< uint256 > vHave
An outpoint - a combination of a transaction hash and an index n into its vout.
std::vector< CTxOut > vout
std::vector< CTransactionRef > vtx
Serialized script, used inside transaction inputs and outputs.
A mutable version of CTransaction.
The basic transaction that is broadcasted on the network and contained in blocks. ...