MCPcopy Create free account
hub / github.com/ElementsProject/elements / AddToBlock

Method AddToBlock

src/node/miner.cpp:285–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void BlockAssembler::AddToBlock(CTxMemPool::txiter iter)
286{
287 pblocktemplate->block.vtx.emplace_back(iter->GetSharedTx());
288 pblocktemplate->vTxFees.push_back(iter->GetFee());
289 pblocktemplate->vTxSigOpsCost.push_back(iter->GetSigOpCost());
290 nBlockWeight += iter->GetTxWeight();
291 ++nBlockTx;
292 nBlockSigOpsCost += iter->GetSigOpCost();
293 nFees += iter->GetFee();
294 inBlock.insert(iter);
295
296 bool fPrintPriority = gArgs.GetBoolArg("-printpriority", DEFAULT_PRINTPRIORITY);
297 if (fPrintPriority) {
298 LogPrintf("fee rate %s txid %s\n",
299 CFeeRate(iter->GetModifiedFee(), iter->GetTxSize()).ToString(),
300 iter->GetTx().GetHash().ToString());
301 }
302}
303
304int BlockAssembler::UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded,
305 indexed_modified_transaction_set &mapModifiedTx)

Callers

nothing calls this directly

Calls 14

emplace_backMethod · 0.80
GetSharedTxMethod · 0.80
GetFeeMethod · 0.80
GetSigOpCostMethod · 0.80
GetTxWeightMethod · 0.80
GetBoolArgMethod · 0.80
GetTxMethod · 0.80
CFeeRateClass · 0.50
push_backMethod · 0.45
insertMethod · 0.45
ToStringMethod · 0.45
GetModifiedFeeMethod · 0.45

Tested by

no test coverage detected