5 #ifndef FABCOIN_CORE_MEMUSAGE_H 6 #define FABCOIN_CORE_MEMUSAGE_H 12 static inline size_t RecursiveDynamicUsage(
const CScript& script) {
13 return memusage::DynamicUsage(script);
16 static inline size_t RecursiveDynamicUsage(
const COutPoint& out) {
20 static inline size_t RecursiveDynamicUsage(
const CTxIn& in) {
23 mem += memusage::DynamicUsage(*it);
28 static inline size_t RecursiveDynamicUsage(
const CTxOut& out) {
32 static inline size_t RecursiveDynamicUsage(
const CTransaction& tx) {
33 size_t mem = memusage::DynamicUsage(tx.
vin) + memusage::DynamicUsage(tx.
vout);
34 for (std::vector<CTxIn>::const_iterator it = tx.
vin.begin(); it != tx.
vin.end(); it++) {
35 mem += RecursiveDynamicUsage(*it);
37 for (std::vector<CTxOut>::const_iterator it = tx.
vout.begin(); it != tx.
vout.end(); it++) {
38 mem += RecursiveDynamicUsage(*it);
44 size_t mem = memusage::DynamicUsage(tx.
vin) + memusage::DynamicUsage(tx.
vout);
45 for (std::vector<CTxIn>::const_iterator it = tx.
vin.begin(); it != tx.
vin.end(); it++) {
46 mem += RecursiveDynamicUsage(*it);
48 for (std::vector<CTxOut>::const_iterator it = tx.
vout.begin(); it != tx.
vout.end(); it++) {
49 mem += RecursiveDynamicUsage(*it);
54 static inline size_t RecursiveDynamicUsage(
const CBlock& block) {
55 size_t mem = memusage::DynamicUsage(block.
vtx);
56 for (
const auto& tx : block.
vtx) {
57 mem += memusage::DynamicUsage(tx) + RecursiveDynamicUsage(*tx);
62 static inline size_t RecursiveDynamicUsage(
const CBlockLocator& locator) {
63 return memusage::DynamicUsage(locator.
vHave);
67 static inline size_t RecursiveDynamicUsage(
const std::shared_ptr<X>& p) {
68 return p ? memusage::DynamicUsage(p) + RecursiveDynamicUsage(*p) : 0;
71 #endif // FABCOIN_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. ...