5 #ifndef BITCOIN_KERNEL_MEMPOOL_ENTRY_H
6 #define BITCOIN_KERNEL_MEMPOOL_ENTRY_H
42 bool operator()(
const std::reference_wrapper<T>& a,
const std::reference_wrapper<T>& b)
const
44 return a.get().GetTx().GetHash() < b.get().GetTx().GetHash();
49 return a->GetTx().GetHash() < b->GetTx().GetHash();
70 typedef std::set<CTxMemPoolEntryRef, CompareIteratorByHash>
Parents;
71 typedef std::set<CTxMemPoolEntryRef, CompareIteratorByHash>
Children;
102 int64_t time,
unsigned int entry_height,
103 bool spends_coinbase,
129 std::chrono::seconds
GetTime()
const {
return std::chrono::seconds{
nTime}; }
int64_t CAmount
Amount in satoshis (Can be negative)
The block chain is a tree shaped structure starting with the genesis block at the root,...
The basic transaction that is broadcasted on the network and contained in blocks.
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
CTxMemPoolEntry(const CTransactionRef &tx, CAmount fee, int64_t time, unsigned int entry_height, bool spends_coinbase, int64_t sigops_cost, LockPoints lp)
CAmount m_modified_fee
Used for determining the priority of the transaction for mining in a block.
const int64_t sigOpCost
Total sigop cost.
Epoch::Marker m_epoch_marker
epoch when last touched, useful for graph algorithms
int64_t GetSigOpCostWithAncestors() const
const bool spendsCoinbase
keep track of transactions that spend a coinbase
const size_t nTxWeight
... and avoid recomputing tx weight (also used for GetTxSize())
int64_t nSigOpCostWithAncestors
const CTransaction & GetTx() const
unsigned int GetHeight() const
const Parents & GetMemPoolParentsConst() const
std::chrono::seconds GetTime() const
void UpdateDescendantState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount)
std::reference_wrapper< const CTxMemPoolEntry > CTxMemPoolEntryRef
bool GetSpendsCoinbase() const
const int64_t nTime
Local time when entering the mempool.
uint64_t GetCountWithDescendants() const
const size_t nUsageSize
... and total memory usage
void UpdateLockPoints(const LockPoints &lp)
CAmount nModFeesWithAncestors
const LockPoints & GetLockPoints() const
CAmount GetModFeesWithDescendants() const
int64_t GetSigOpCost() const
uint64_t nCountWithDescendants
number of descendant transactions
void UpdateAncestorState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount, int64_t modifySigOps)
uint64_t GetSizeWithAncestors() const
CTransactionRef GetSharedTx() const
uint64_t nSizeWithDescendants
... and size
void UpdateModifiedFee(CAmount fee_diff)
size_t DynamicMemoryUsage() const
std::set< CTxMemPoolEntryRef, CompareIteratorByHash > Children
CAmount nModFeesWithDescendants
... and total fees (all including us)
uint64_t nCountWithAncestors
const CAmount nFee
Cached to avoid expensive parent-transaction lookups.
Parents & GetMemPoolParents() const
CAmount GetModFeesWithAncestors() const
uint64_t GetSizeWithDescendants() const
uint64_t GetCountWithAncestors() const
LockPoints lockPoints
Track the height and time at which tx was final.
CAmount GetModifiedFee() const
uint64_t nSizeWithAncestors
const CAmount & GetFee() const
const Children & GetMemPoolChildrenConst() const
const unsigned int entryHeight
Chain height when entering the mempool.
Children & GetMemPoolChildren() const
size_t vTxHashesIdx
Index in mempool's vTxHashes.
std::set< CTxMemPoolEntryRef, CompareIteratorByHash > Parents
size_t GetTxWeight() const
static int64_t GetTransactionWeight(const CTransaction &tx)
static size_t RecursiveDynamicUsage(const CScript &script)
T SaturatingAdd(const T i, const T j) noexcept
unsigned int nBytesPerSigOp
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
std::shared_ptr< const CTransaction > CTransactionRef
bool operator()(const T &a, const T &b) const
bool operator()(const std::reference_wrapper< T > &a, const std::reference_wrapper< T > &b) const
CBlockIndex * maxInputBlock