Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | BlockAssembler::CreateNewBlock(const CScript &scriptPubKeyIn) { | ||||
} | } | ||||
pblock->vtx[0] = MakeTransactionRef(coinbaseTx); | pblock->vtx[0] = MakeTransactionRef(coinbaseTx); | ||||
pblocktemplate->vTxFees[0] = -1 * nFees; | pblocktemplate->vTxFees[0] = -1 * nFees; | ||||
uint64_t nSerializeSize = | uint64_t nSerializeSize = | ||||
GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION); | GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION); | ||||
LogPrintf("CreateNewBlock(): total size: %u txs: %u fees: %ld sigops %d\n", | LogPrint(BCLog::BENCH, | ||||
"CreateNewBlock(): total size: %u txs: %u fees: %ld sigops %d\n", | |||||
nSerializeSize, nBlockTx, nFees, nBlockSigOps); | nSerializeSize, nBlockTx, nFees, nBlockSigOps); | ||||
// Fill in header. | // Fill in header. | ||||
pblock->hashPrevBlock = pindexPrev->GetBlockHash(); | pblock->hashPrevBlock = pindexPrev->GetBlockHash(); | ||||
UpdateTime(pblock, *config, pindexPrev); | UpdateTime(pblock, *config, pindexPrev); | ||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, *config); | pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, *config); | ||||
pblock->nNonce = 0; | pblock->nNonce = 0; | ||||
pblocktemplate->vTxSigOpsCount[0] = GetSigOpCountWithoutP2SH( | pblocktemplate->vTxSigOpsCount[0] = GetSigOpCountWithoutP2SH( | ||||
*pblock->vtx[0], STANDARD_CHECKDATASIG_VERIFY_FLAGS); | *pblock->vtx[0], STANDARD_CHECKDATASIG_VERIFY_FLAGS); | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | void BlockAssembler::AddToBlock(CTxMemPool::txiter iter) { | ||||
inBlock.insert(iter); | inBlock.insert(iter); | ||||
bool fPrintPriority = | bool fPrintPriority = | ||||
gArgs.GetBoolArg("-printpriority", DEFAULT_PRINTPRIORITY); | gArgs.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().GetId(), dPriority, dummy); | ||||
LogPrintf( | LogPrint(BCLog::BENCH, "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().GetId().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 323 Lines • Show Last 20 Lines |