Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 219 Lines • ▼ Show 20 Lines | struct update_lock_points { | ||||
explicit update_lock_points(const LockPoints &_lp) : lp(_lp) {} | explicit update_lock_points(const LockPoints &_lp) : lp(_lp) {} | ||||
void operator()(CTxMemPoolEntry &e) { e.UpdateLockPoints(lp); } | void operator()(CTxMemPoolEntry &e) { e.UpdateLockPoints(lp); } | ||||
private: | private: | ||||
const LockPoints &lp; | const LockPoints &lp; | ||||
}; | }; | ||||
// extracts a transaction hash from CTxMempoolEntry or CTransactionRef | // extracts a transaction hash from CTxMemPoolEntry or CTransactionRef | ||||
struct mempoolentry_txid { | struct mempoolentry_txid { | ||||
typedef uint256 result_type; | typedef uint256 result_type; | ||||
result_type operator()(const CTxMemPoolEntry &entry) const { | result_type operator()(const CTxMemPoolEntry &entry) const { | ||||
return entry.GetTx().GetId(); | return entry.GetTx().GetId(); | ||||
} | } | ||||
result_type operator()(const CTransactionRef &tx) const { | result_type operator()(const CTransactionRef &tx) const { | ||||
return tx->GetId(); | return tx->GetId(); | ||||
▲ Show 20 Lines • Show All 403 Lines • ▼ Show 20 Lines | public: | ||||
void removeConflicts(const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(cs); | void removeConflicts(const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(cs); | ||||
void removeForBlock(const std::vector<CTransactionRef> &vtx, | void removeForBlock(const std::vector<CTransactionRef> &vtx, | ||||
unsigned int nBlockHeight); | unsigned int nBlockHeight); | ||||
void clear(); | void clear(); | ||||
// lock free | // lock free | ||||
void _clear() EXCLUSIVE_LOCKS_REQUIRED(cs); | void _clear() EXCLUSIVE_LOCKS_REQUIRED(cs); | ||||
bool CompareDepthAndScore(const uint256 &hasha, const uint256 &hashb); | bool CompareDepthAndScore(const uint256 &hasha, const uint256 &hashb); | ||||
void queryHashes(std::vector<uint256> &vtxid); | void queryHashes(std::vector<uint256> &vtxid) const; | ||||
bool isSpent(const COutPoint &outpoint) const; | bool isSpent(const COutPoint &outpoint) const; | ||||
unsigned int GetTransactionsUpdated() const; | unsigned int GetTransactionsUpdated() const; | ||||
void AddTransactionsUpdated(unsigned int n); | void AddTransactionsUpdated(unsigned int n); | ||||
/** | /** | ||||
* Check that none of this transactions inputs are in the mempool, and thus | * Check that none of this transactions inputs are in the mempool, and thus | ||||
* the tx is not dependent on other mempool transactions to be included in a | * the tx is not dependent on other mempool transactions to be included in a | ||||
* block. | * block. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 332 Lines • Show Last 20 Lines |