Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
// Unconfirmed transactions in the memory pool often depend on other | // Unconfirmed transactions in the memory pool often depend on other | ||||
// transactions in the memory pool. When we select transactions from the | // transactions in the memory pool. When we select transactions from the | ||||
// pool, we select by highest priority or fee rate, so we might consider | // pool, we select by highest priority or fee rate, so we might consider | ||||
// transactions that depend on transactions that aren't yet in the block. | // transactions that depend on transactions that aren't yet in the block. | ||||
uint64_t nLastBlockTx = 0; | uint64_t nLastBlockTx = 0; | ||||
uint64_t nLastBlockSize = 0; | uint64_t nLastBlockSize = 0; | ||||
class ScoreCompare { | |||||
public: | |||||
ScoreCompare() {} | |||||
bool operator()(const CTxMemPool::txiter a, const CTxMemPool::txiter b) { | |||||
// Convert to less than. | |||||
return CompareTxMemPoolEntryByScore()(*b, *a); | |||||
} | |||||
}; | |||||
int64_t UpdateTime(CBlockHeader *pblock, const Config &config, | int64_t UpdateTime(CBlockHeader *pblock, const Config &config, | ||||
const CBlockIndex *pindexPrev) { | const CBlockIndex *pindexPrev) { | ||||
int64_t nOldTime = pblock->nTime; | int64_t nOldTime = pblock->nTime; | ||||
int64_t nNewTime = | int64_t nNewTime = | ||||
std::max(pindexPrev->GetMedianTimePast() + 1, GetAdjustedTime()); | std::max(pindexPrev->GetMedianTimePast() + 1, GetAdjustedTime()); | ||||
if (nOldTime < nNewTime) { | if (nOldTime < nNewTime) { | ||||
pblock->nTime = nNewTime; | pblock->nTime = nNewTime; | ||||
▲ Show 20 Lines • Show All 589 Lines • Show Last 20 Lines |