CTxMemPool: encapsulate AddToMemoryPoolUnchecked(), RemoveFromMemoryPool(),

and nPooledTx
This commit is contained in:
Jeff Garzik
2012-04-13 16:28:07 -04:00
committed by Jeff Garzik
parent 235507ae48
commit 8e45ed66dd
3 changed files with 31 additions and 28 deletions

View File

@@ -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