Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | private: | ||||
//!< ... and avoid recomputing tx size | //!< ... and avoid recomputing tx size | ||||
size_t nTxSize; | size_t nTxSize; | ||||
//!< ... and modified size for priority | //!< ... and modified size for priority | ||||
size_t nModSize; | size_t nModSize; | ||||
//!< ... and total memory usage | //!< ... and total memory usage | ||||
size_t nUsageSize; | size_t nUsageSize; | ||||
//!< Local time when entering the mempool | //!< Local time when entering the mempool | ||||
int64_t nTime; | int64_t nTime; | ||||
//!< Priority when entering the mempool | |||||
double entryPriority; | |||||
//!< Chain height when entering the mempool | //!< Chain height when entering the mempool | ||||
unsigned int entryHeight; | unsigned int entryHeight; | ||||
//!< Sum of all txin values that are already in blockchain | |||||
Amount inChainInputValue; | |||||
//!< keep track of transactions that spend a coinbase | //!< keep track of transactions that spend a coinbase | ||||
bool spendsCoinbase; | bool spendsCoinbase; | ||||
//!< Total sigop plus P2SH sigops count | //!< Total sigop plus P2SH sigops count | ||||
int64_t sigOpCount; | int64_t sigOpCount; | ||||
//!< Used for determining the priority of the transaction for mining in a | //!< Used for determining the priority of the transaction for mining in a | ||||
//! block | //! block | ||||
Amount feeDelta; | Amount feeDelta; | ||||
//!< Track the height and time at which tx was final | //!< Track the height and time at which tx was final | ||||
Show All 13 Lines | private: | ||||
// Analogous statistics for ancestor transactions | // Analogous statistics for ancestor transactions | ||||
uint64_t nCountWithAncestors; | uint64_t nCountWithAncestors; | ||||
uint64_t nSizeWithAncestors; | uint64_t nSizeWithAncestors; | ||||
Amount nModFeesWithAncestors; | Amount nModFeesWithAncestors; | ||||
int64_t nSigOpCountWithAncestors; | int64_t nSigOpCountWithAncestors; | ||||
public: | public: | ||||
CTxMemPoolEntry(const CTransactionRef &_tx, const Amount _nFee, | CTxMemPoolEntry(const CTransactionRef &_tx, const Amount _nFee, | ||||
int64_t _nTime, double _entryPriority, | int64_t _nTime, unsigned int _entryHeight, | ||||
unsigned int _entryHeight, Amount _inChainInputValue, | |||||
bool spendsCoinbase, int64_t nSigOpsCost, LockPoints lp); | bool spendsCoinbase, int64_t nSigOpsCost, LockPoints lp); | ||||
const CTransaction &GetTx() const { return *this->tx; } | const CTransaction &GetTx() const { return *this->tx; } | ||||
CTransactionRef GetSharedTx() const { return this->tx; } | CTransactionRef GetSharedTx() const { return this->tx; } | ||||
const Amount GetFee() const { return nFee; } | const Amount GetFee() const { return nFee; } | ||||
size_t GetTxSize() const { return nTxSize; } | size_t GetTxSize() const { return nTxSize; } | ||||
int64_t GetTime() const { return nTime; } | int64_t GetTime() const { return nTime; } | ||||
▲ Show 20 Lines • Show All 716 Lines • ▼ Show 20 Lines | |||||
* CCoinsView that brings transactions from a mempool into view. | * CCoinsView that brings transactions from a mempool into view. | ||||
* It does not check for spendings by memory pool transactions. | * It does not check for spendings by memory pool transactions. | ||||
* Instead, it provides access to all Coins which are either unspent in the | * Instead, it provides access to all Coins which are either unspent in the | ||||
* base CCoinsView, or are outputs from any mempool transaction! | * base CCoinsView, or are outputs from any mempool transaction! | ||||
* This allows transaction replacement to work as expected, as you want to | * This allows transaction replacement to work as expected, as you want to | ||||
* have all inputs "available" to check signatures, and any cycles in the | * have all inputs "available" to check signatures, and any cycles in the | ||||
* dependency graph are checked directly in AcceptToMemoryPool. | * dependency graph are checked directly in AcceptToMemoryPool. | ||||
* It also allows you to sign a double-spend directly in | * It also allows you to sign a double-spend directly in | ||||
* signrawtransactionwithkey and signrawtransactionwithwallet, as long as the | * signrawtransactionwithkey and signrawtransactionwithwallet, | ||||
* conflicting transaction is not yet confirmed. | * as long as the conflicting transaction is not yet confirmed. | ||||
*/ | */ | ||||
class CCoinsViewMemPool : public CCoinsViewBacked { | class CCoinsViewMemPool : public CCoinsViewBacked { | ||||
protected: | protected: | ||||
const CTxMemPool &mempool; | const CTxMemPool &mempool; | ||||
public: | public: | ||||
CCoinsViewMemPool(CCoinsView *baseIn, const CTxMemPool &mempoolIn); | CCoinsViewMemPool(CCoinsView *baseIn, const CTxMemPool &mempoolIn); | ||||
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; | bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |