MCPcopy Create free account
hub / github.com/LUX-Core/lux / AddToBlock

Method AddToBlock

src/miner.cpp:751–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749}
750
751void BlockAssembler::AddToBlock(CTxMemPool::txiter iter)
752{
753 pblock->vtx.emplace_back(iter->GetTx());
754 pblocktemplate->vTxFees.push_back(iter->GetFee());
755 pblocktemplate->vTxSigOpsCost.push_back(iter->GetSigOpCost());
756 if (fNeedSizeAccounting) {
757 nBlockSize += ::GetSerializeSize(iter->GetTx(), SER_NETWORK, PROTOCOL_VERSION);
758 }
759 nBlockWeight += iter->GetTxWeight();
760 ++nBlockTx;
761 nBlockSigOpsCost += iter->GetSigOpCost();
762 nFees += iter->GetFee();
763 inBlock.insert(iter);
764
765 bool fPrintPriority = GetBoolArg("-printpriority", DEFAULT_PRINTPRIORITY);
766 if (fPrintPriority) {
767 double dPriority = iter->GetPriority(nHeight);
768 CAmount dummy;
769 mempool.ApplyDeltas(iter->GetTx().GetHash(), dPriority, dummy);
770 LogPrintf("priority %.1f fee %s txid %s\n",
771 dPriority,
772 CFeeRate(iter->GetModifiedFee(), iter->GetTxSize()).ToString(),
773 iter->GetTx().GetHash().ToString());
774 }
775
776}
777
778void BlockAssembler::UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded,
779 indexed_modified_transaction_set &mapModifiedTx)

Callers

nothing calls this directly

Calls 14

GetSerializeSizeFunction · 0.85
GetBoolArgFunction · 0.85
GetFeeMethod · 0.80
GetSigOpCostMethod · 0.80
GetTxWeightMethod · 0.80
ApplyDeltasMethod · 0.80
CFeeRateClass · 0.70
push_backMethod · 0.45
insertMethod · 0.45
GetPriorityMethod · 0.45
GetHashMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected