Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | void BlockAssembler::AddToBlock(CTxMemPool::txiter iter) { | ||||
nBlockSigOps += iter->GetSigOpCount(); | nBlockSigOps += iter->GetSigOpCount(); | ||||
nFees += iter->GetFee(); | nFees += iter->GetFee(); | ||||
inBlock.insert(iter); | inBlock.insert(iter); | ||||
bool fPrintPriority = GetBoolArg("-printpriority", DEFAULT_PRINTPRIORITY); | bool fPrintPriority = GetBoolArg("-printpriority", DEFAULT_PRINTPRIORITY); | ||||
if (fPrintPriority) { | if (fPrintPriority) { | ||||
double dPriority = iter->GetPriority(nHeight); | double dPriority = iter->GetPriority(nHeight); | ||||
Amount dummy; | Amount dummy; | ||||
mempool.ApplyDeltas(iter->GetTx().GetId(), dPriority, dummy); | mempool.ApplyDeltas(iter->GetTx().GetHash(), dPriority, dummy); | ||||
LogPrintf( | LogPrintf( | ||||
"priority %.1f fee %s txid %s\n", dPriority, | "priority %.1f fee %s txid %s\n", dPriority, | ||||
CFeeRate(iter->GetModifiedFee(), iter->GetTxSize()).ToString(), | CFeeRate(iter->GetModifiedFee(), iter->GetTxSize()).ToString(), | ||||
iter->GetTx().GetId().ToString()); | iter->GetTx().GetHash().ToString()); | ||||
} | } | ||||
} | } | ||||
int BlockAssembler::UpdatePackagesForAdded( | int BlockAssembler::UpdatePackagesForAdded( | ||||
const CTxMemPool::setEntries &alreadyAdded, | const CTxMemPool::setEntries &alreadyAdded, | ||||
indexed_modified_transaction_set &mapModifiedTx) { | indexed_modified_transaction_set &mapModifiedTx) { | ||||
int nDescendantsUpdated = 0; | int nDescendantsUpdated = 0; | ||||
for (const CTxMemPool::txiter it : alreadyAdded) { | for (const CTxMemPool::txiter it : alreadyAdded) { | ||||
▲ Show 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | void BlockAssembler::addPriorityTxs() { | ||||
double actualPriority = -1; | double actualPriority = -1; | ||||
vecPriority.reserve(mempool.mapTx.size()); | vecPriority.reserve(mempool.mapTx.size()); | ||||
for (CTxMemPool::indexed_transaction_set::iterator mi = | for (CTxMemPool::indexed_transaction_set::iterator mi = | ||||
mempool.mapTx.begin(); | mempool.mapTx.begin(); | ||||
mi != mempool.mapTx.end(); ++mi) { | mi != mempool.mapTx.end(); ++mi) { | ||||
double dPriority = mi->GetPriority(nHeight); | double dPriority = mi->GetPriority(nHeight); | ||||
Amount dummy; | Amount dummy; | ||||
mempool.ApplyDeltas(mi->GetTx().GetId(), dPriority, dummy); | mempool.ApplyDeltas(mi->GetTx().GetHash(), dPriority, dummy); | ||||
vecPriority.push_back(TxCoinAgePriority(dPriority, mi)); | vecPriority.push_back(TxCoinAgePriority(dPriority, mi)); | ||||
} | } | ||||
std::make_heap(vecPriority.begin(), vecPriority.end(), pricomparer); | std::make_heap(vecPriority.begin(), vecPriority.end(), pricomparer); | ||||
CTxMemPool::txiter iter; | CTxMemPool::txiter iter; | ||||
// Add a tx from priority queue to fill the part of block reserved to | // Add a tx from priority queue to fill the part of block reserved to | ||||
// priority transactions. | // priority transactions. | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |