Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | nLockTimeCutoff = | ||||
? pindexPrev->GetMedianTimePast() | ? pindexPrev->GetMedianTimePast() | ||||
: pblock->GetBlockTime(); | : pblock->GetBlockTime(); | ||||
addPriorityTxs(); | addPriorityTxs(); | ||||
int nPackagesSelected = 0; | int nPackagesSelected = 0; | ||||
int nDescendantsUpdated = 0; | int nDescendantsUpdated = 0; | ||||
addPackageTxs(nPackagesSelected, nDescendantsUpdated); | addPackageTxs(nPackagesSelected, nDescendantsUpdated); | ||||
if (IsMagneticAnomalyEnabled(*config, pindexPrev)) { | |||||
// If magnetic anomaly is enabled, we make sure transaction are | |||||
// canonically ordered. | |||||
std::sort(std::begin(pblock->vtx) + 1, std::end(pblock->vtx), | |||||
[](const std::shared_ptr<const CTransaction> &a, | |||||
const std::shared_ptr<const CTransaction> &b) -> bool { | |||||
return a->GetId() > b->GetId(); | |||||
}); | |||||
} | |||||
int64_t nTime1 = GetTimeMicros(); | int64_t nTime1 = GetTimeMicros(); | ||||
nLastBlockTx = nBlockTx; | nLastBlockTx = nBlockTx; | ||||
nLastBlockSize = nBlockSize; | nLastBlockSize = nBlockSize; | ||||
// Create coinbase transaction. | // Create coinbase transaction. | ||||
CMutableTransaction coinbaseTx; | CMutableTransaction coinbaseTx; | ||||
coinbaseTx.vin.resize(1); | coinbaseTx.vin.resize(1); | ||||
▲ Show 20 Lines • Show All 486 Lines • Show Last 20 Lines |