5#ifndef BITCOIN_KERNEL_MEMPOOL_ENTRY_H
6#define BITCOIN_KERNEL_MEMPOOL_ENTRY_H
43 bool operator()(
const std::reference_wrapper<T>& a,
const std::reference_wrapper<T>& b)
const
45 return a.get().GetTx().GetHash() < b.get().GetTx().GetHash();
50 return a->GetTx().GetHash() < b->GetTx().GetHash();
118 std::chrono::seconds
GetTime()
const {
return std::chrono::seconds{
nTime}; }
173 :
info{entry.GetSharedTx(), entry.GetFee(), entry.GetTxSize(), entry.GetHeight()} {}
194 const int64_t vsize,
const unsigned int height,
195 const bool mempool_limit_bypassed,
const bool submitted_in_package,
196 const bool chainstate_is_current,
197 const bool has_no_mempool_parents)
198 :
info{tx,
fee, vsize, height},
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...
CAmount m_modified_fee
Used for determining the priority of the transaction for mining in a block.
CTxMemPoolEntry(CTxMemPoolEntry &&)=default
const int64_t sigOpCost
Total sigop cost.
const LockPoints & GetLockPoints() const
Epoch::Marker m_epoch_marker
epoch when last touched, useful for graph algorithms
CTxMemPoolEntry & operator=(const CTxMemPoolEntry &)=delete
const bool spendsCoinbase
keep track of transactions that spend a coinbase
uint64_t GetSequence() const
unsigned int GetHeight() const
std::chrono::seconds GetTime() const
const CTransaction & GetTx() const
virtual ~CTxMemPoolEntry()=default
int32_t GetTxWeight() const
CTxMemPoolEntry(TxGraph::Ref &&ref, const CTransactionRef &tx, CAmount fee, int64_t time, unsigned int entry_height, uint64_t entry_sequence, bool spends_coinbase, int64_t sigops_cost, LockPoints lp)
std::reference_wrapper< const CTxMemPoolEntry > CTxMemPoolEntryRef
bool GetSpendsCoinbase() const
const int64_t nTime
Local time when entering the mempool.
size_t idx_randomized
Index in mempool's txns_randomized.
const size_t nUsageSize
... and total memory usage
const uint64_t entry_sequence
Sequence number used to determine whether this transaction is too recent for relay.
int64_t GetSigOpCost() const
int32_t GetAdjustedWeight() const
CTransactionRef GetSharedTx() const
CTxMemPoolEntry(const CTxMemPoolEntry &)=delete
size_t DynamicMemoryUsage() const
int32_t GetTxSize() const
const int32_t nTxWeight
... and avoid recomputing tx weight (also used for GetTxSize())
const CAmount nFee
Cached to avoid expensive parent-transaction lookups.
const CAmount & GetFee() const
LockPoints lockPoints
Track the height and time at which tx was final.
CAmount GetModifiedFee() const
CTxMemPoolEntry & operator=(CTxMemPoolEntry &&)=delete
void UpdateLockPoints(const LockPoints &lp) const
const unsigned int entryHeight
Chain height when entering the mempool.
void UpdateModifiedFee(CAmount fee_diff) const
Ref() noexcept=default
Construct an empty Ref.
Data structure to encapsulate fees, sizes, and dependencies for a set of transactions.
static int32_t GetTransactionWeight(const CTransaction &tx)
static size_t RecursiveDynamicUsage(const CScript &script)
CTxMemPoolEntry::CTxMemPoolEntryRef CTxMemPoolEntryRef
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).
int64_t GetSigOpsAdjustedWeight(int64_t weight, int64_t sigop_cost, unsigned int bytes_per_sigop)
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
const bool m_submitted_in_package
const bool m_has_no_mempool_parents
const bool m_chainstate_is_current
const bool m_mempool_limit_bypassed
NewMempoolTransactionInfo(const CTransactionRef &tx, const CAmount &fee, const int64_t vsize, const unsigned int height, const bool mempool_limit_bypassed, const bool submitted_in_package, const bool chainstate_is_current, const bool has_no_mempool_parents)
RemovedMempoolTransactionInfo(const CTxMemPoolEntry &entry)
TransactionInfo(const CTransactionRef &tx, const CAmount &fee, const int64_t vsize, const unsigned int height)
const unsigned int txHeight
const CTransactionRef m_tx
const int64_t m_virtual_transaction_size
The virtual transaction size.