CTxMemPool: encapsulate AddToMemoryPoolUnchecked(), RemoveFromMemoryPool(),
and nPooledTx
This commit is contained in:
15
src/main.h
15
src/main.h
@@ -67,7 +67,6 @@ extern CBigNum bnBestChainWork;
|
||||
extern CBigNum bnBestInvalidWork;
|
||||
extern uint256 hashBestChain;
|
||||
extern CBlockIndex* pindexBest;
|
||||
extern uint64 nPooledTx;
|
||||
extern unsigned int nTransactionsUpdated;
|
||||
extern uint64 nLastBlockTx;
|
||||
extern uint64 nLastBlockSize;
|
||||
@@ -689,9 +688,6 @@ public:
|
||||
|
||||
protected:
|
||||
const CTxOut& GetOutputFor(const CTxIn& input, const MapPrevTx& inputs) const;
|
||||
bool AddToMemoryPoolUnchecked();
|
||||
public:
|
||||
bool RemoveFromMemoryPool();
|
||||
};
|
||||
|
||||
|
||||
@@ -1614,6 +1610,17 @@ public:
|
||||
mutable CCriticalSection cs;
|
||||
std::map<uint256, CTransaction> mapTx;
|
||||
std::map<COutPoint, CInPoint> mapNextTx;
|
||||
|
||||
bool addUnchecked(CTransaction &tx);
|
||||
bool remove(CTransaction &tx);
|
||||
|
||||
unsigned long size()
|
||||
{
|
||||
LOCK(cs);
|
||||
return mapTx.size();
|
||||
}
|
||||
};
|
||||
|
||||
extern CTxMemPool mempool;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user