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();
116 std::chrono::seconds
GetTime()
const {
return std::chrono::seconds{
nTime}; }
191 const int64_t vsize,
const unsigned int height,
192 const bool mempool_limit_bypassed,
const bool submitted_in_package,
193 const bool chainstate_is_current,
194 const bool has_no_mempool_parents)
195 :
info{tx,
fee, vsize, height},
202 #endif // BITCOIN_KERNEL_MEMPOOL_ENTRY_H std::shared_ptr< const CTransaction > CTransactionRef
const bool spendsCoinbase
keep track of transactions that spend a coinbase
int32_t GetTxWeight() const
CAmount m_modified_fee
Used for determining the priority of the transaction for mining in a block.
int32_t GetTxSize() const
const int32_t nTxWeight
... and avoid recomputing tx weight (also used for GetTxSize())
const uint64_t entry_sequence
Sequence number used to determine whether this transaction is too recent for relay.
const bool m_submitted_in_package
const unsigned int entryHeight
Chain height when entering the mempool.
CTxMemPoolEntry & operator=(const CTxMemPoolEntry &)=delete
bool GetSpendsCoinbase() const
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
const int64_t nTime
Local time when entering the mempool.
void UpdateModifiedFee(CAmount fee_diff) const
CTxMemPoolEntry::CTxMemPoolEntryRef CTxMemPoolEntryRef
static int32_t GetTransactionWeight(const CTransaction &tx)
virtual ~CTxMemPoolEntry()=default
CAmount GetModifiedFee() const
bool operator()(const std::reference_wrapper< T > &a, const std::reference_wrapper< T > &b) const
bool operator()(const T &a, const T &b) const
int32_t GetAdjustedWeight() const
const int64_t m_virtual_transaction_size
The virtual transaction size.
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
int64_t CAmount
Amount in satoshis (Can be negative)
int64_t GetSigOpsAdjustedWeight(int64_t weight, int64_t sigop_cost, unsigned int bytes_per_sigop)
const bool m_chainstate_is_current
size_t DynamicMemoryUsage() const
unsigned int GetHeight() const
RemovedMempoolTransactionInfo(const CTxMemPoolEntry &entry)
const CAmount & GetFee() const
CTransactionRef GetSharedTx() const
TransactionInfo(const CTransactionRef &tx, const CAmount &fee, const int64_t vsize, const unsigned int height)
std::chrono::seconds GetTime() const
const size_t nUsageSize
... and total memory usage
uint64_t GetSequence() const
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)
CTxMemPoolEntry(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)
CTxMemPoolEntry(const CTxMemPoolEntry &)=delete
const int64_t sigOpCost
Total sigop cost.
const bool m_has_no_mempool_parents
T SaturatingAdd(const T i, const T j) noexcept
unsigned int nBytesPerSigOp
void UpdateLockPoints(const LockPoints &lp) const
const bool m_mempool_limit_bypassed
The block chain is a tree shaped structure starting with the genesis block at the root...
LockPoints lockPoints
Track the height and time at which tx was final.
const CTransaction & GetTx() const
std::reference_wrapper< const CTxMemPoolEntry > CTxMemPoolEntryRef
const CTransactionRef m_tx
int64_t GetSigOpCost() const
const CAmount nFee
Cached to avoid expensive parent-transaction lookups.
static size_t RecursiveDynamicUsage(const CScript &script)
The basic transaction that is broadcasted on the network and contained in blocks. ...
const LockPoints & GetLockPoints() const
CBlockIndex * maxInputBlock
const unsigned int txHeight
size_t idx_randomized
Index in mempool's txns_randomized.