diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-10 17:34:17 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-11-19 17:53:23 -0800 |
commit | b4e4ba475a5679e09f279aaf2a83dcf93c632bdb (patch) | |
tree | 31f4d8edd5134e92bf133ee3dfd52651c14ed21e /src/txmempool.h | |
parent | 1662b437b33b7ec5a1723f6ae6187d3bdd06f593 (diff) |
Introduce convenience type CTransactionRef
Diffstat (limited to 'src/txmempool.h')
-rw-r--r-- | src/txmempool.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/txmempool.h b/src/txmempool.h index 6952cc9006..29b59363a2 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -80,7 +80,7 @@ class CTxMemPool; class CTxMemPoolEntry { private: - std::shared_ptr<const CTransaction> tx; + CTransactionRef tx; CAmount nFee; //!< Cached to avoid expensive parent-transaction lookups size_t nTxWeight; //!< ... and avoid recomputing tx weight (also used for GetTxSize()) size_t nModSize; //!< ... and modified size for priority @@ -118,7 +118,7 @@ public: CTxMemPoolEntry(const CTxMemPoolEntry& other); const CTransaction& GetTx() const { return *this->tx; } - std::shared_ptr<const CTransaction> GetSharedTx() const { return this->tx; } + CTransactionRef GetSharedTx() const { return this->tx; } /** * Fast calculation of lower bound of current priority as update * from entry priority. Only inputs that were originally in-chain will age. @@ -322,7 +322,7 @@ class CBlockPolicyEstimator; struct TxMempoolInfo { /** The transaction itself */ - std::shared_ptr<const CTransaction> tx; + CTransactionRef tx; /** Time the transaction entered the mempool. */ int64_t nTime; @@ -527,11 +527,11 @@ public: bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, bool fCurrentEstimate = true); bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, setEntries &setAncestors, bool fCurrentEstimate = true); - void removeRecursive(const CTransaction &tx, std::vector<std::shared_ptr<const CTransaction>>* removed = NULL); + void removeRecursive(const CTransaction &tx, std::vector<CTransactionRef>* removed = NULL); void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags); - void removeConflicts(const CTransaction &tx, std::vector<std::shared_ptr<const CTransaction>>* removed = NULL); - void removeForBlock(const std::vector<std::shared_ptr<const CTransaction>>& vtx, unsigned int nBlockHeight, - std::vector<std::shared_ptr<const CTransaction>>* conflicts = NULL, bool fCurrentEstimate = true); + void removeConflicts(const CTransaction &tx, std::vector<CTransactionRef>* removed = NULL); + void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight, + std::vector<CTransactionRef>* conflicts = NULL, bool fCurrentEstimate = true); void clear(); void _clear(); //lock free bool CompareDepthAndScore(const uint256& hasha, const uint256& hashb); @@ -623,7 +623,7 @@ public: return (mapTx.count(hash) != 0); } - std::shared_ptr<const CTransaction> get(const uint256& hash) const; + CTransactionRef get(const uint256& hash) const; TxMempoolInfo info(const uint256& hash) const; std::vector<TxMempoolInfo> infoAll() const; |