aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
diff options
context:
space:
mode:
authorAshley Holman <dscvlt@gmail.com>2015-06-24 03:32:20 -0500
committerSuhas Daftuar <sdaftuar@chaincode.com>2015-09-19 13:22:40 -0400
commit34628a18070064e75b35f28fd6a43d5c23832eb8 (patch)
treee73c13d25d04212b5bbbb5b0c3829421f7616d6b /src/miner.cpp
parentd5d1d2e65a1c3b91452d2428410f701bca1e53cc (diff)
TxMemPool: Change mapTx to a boost::multi_index_container
Indexes on: - Tx Hash - Fee Rate (fee-per-kb)
Diffstat (limited to 'src/miner.cpp')
-rw-r--r--src/miner.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/miner.cpp b/src/miner.cpp
index 9dd1d459b5..b2a356e52d 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -158,10 +158,10 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
// This vector will be sorted into a priority queue:
vector<TxPriority> vecPriority;
vecPriority.reserve(mempool.mapTx.size());
- for (map<uint256, CTxMemPoolEntry>::iterator mi = mempool.mapTx.begin();
+ for (CTxMemPool::indexed_transaction_set::iterator mi = mempool.mapTx.begin();
mi != mempool.mapTx.end(); ++mi)
{
- const CTransaction& tx = mi->second.GetTx();
+ const CTransaction& tx = mi->GetTx();
if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, pblock->nTime))
continue;
@@ -196,7 +196,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
}
mapDependers[txin.prevout.hash].push_back(porphan);
porphan->setDependsOn.insert(txin.prevout.hash);
- nTotalIn += mempool.mapTx[txin.prevout.hash].GetTx().vout[txin.prevout.n].nValue;
+ nTotalIn += mempool.mapTx.find(txin.prevout.hash)->GetTx().vout[txin.prevout.n].nValue;
continue;
}
const CCoins* coins = view.AccessCoins(txin.prevout.hash);
@@ -226,7 +226,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
porphan->feeRate = feeRate;
}
else
- vecPriority.push_back(TxPriority(dPriority, feeRate, &mi->second.GetTx()));
+ vecPriority.push_back(TxPriority(dPriority, feeRate, &(mi->GetTx())));
}
// Collect transactions into block