replace mapNextTx with slimmer setSpends

This commit is contained in:
Kaz Wesley
2016-04-30 21:45:26 -07:00
committed by lateminer
parent 17401c86d1
commit 000a97ca5f
6 changed files with 96 additions and 41 deletions

View File

@@ -11,6 +11,7 @@
#include "amount.h"
#include "coins.h"
#include "indirectmap.h"
#include "primitives/transaction.h"
#include "sync.h"
@@ -306,20 +307,6 @@ struct ancestor_score {};
class CBlockPolicyEstimator;
/** An inpoint - a combination of a transaction and an index n into its vin */
class CInPoint
{
public:
const CTransaction* ptx;
uint32_t n;
CInPoint() { SetNull(); }
CInPoint(const CTransaction* ptxIn, uint32_t nIn) { ptx = ptxIn; n = nIn; }
void SetNull() { ptx = NULL; n = (uint32_t) -1; }
bool IsNull() const { return (ptx == NULL && n == (uint32_t) -1); }
size_t DynamicMemoryUsage() const { return 0; }
};
/**
* CTxMemPool stores valid-according-to-the-current-best-chain
* transactions that may be included in the next block.
@@ -478,7 +465,7 @@ private:
void UpdateChild(txiter entry, txiter child, bool add);
public:
std::map<COutPoint, CInPoint> mapNextTx;
indirectmap<COutPoint, const CTransaction*> mapNextTx;
std::map<uint256, std::pair<double, CAmount> > mapDeltas;
/** Create a new CTxMemPool.