@@ -338,66 +338,6 @@ void BlockAssembler::AddToBlock(CTxMemPool::txiter iter)
338
338
}
339
339
}
340
340
341
- void BlockAssembler::addScoreTxs ()
342
- {
343
- std::priority_queue<CTxMemPool::txiter, std::vector<CTxMemPool::txiter>, ScoreCompare> clearedTxs;
344
- CTxMemPool::setEntries waitSet;
345
- CTxMemPool::indexed_transaction_set::index<mining_score>::type::iterator mi = mempool.mapTx .get <mining_score>().begin ();
346
- CTxMemPool::txiter iter;
347
- while (!blockFinished && (mi != mempool.mapTx .get <mining_score>().end () || !clearedTxs.empty ()))
348
- {
349
- // If no txs that were previously postponed are available to try
350
- // again, then try the next highest score tx
351
- if (clearedTxs.empty ()) {
352
- iter = mempool.mapTx .project <0 >(mi);
353
- mi++;
354
- }
355
- // If a previously postponed tx is available to try again, then it
356
- // has higher score than all untried so far txs
357
- else {
358
- iter = clearedTxs.top ();
359
- clearedTxs.pop ();
360
- }
361
-
362
- // If tx already in block, skip (added by addPriorityTxs)
363
- if (inBlock.count (iter)) {
364
- continue ;
365
- }
366
-
367
- // cannot accept witness transactions into a non-witness block
368
- if (!fIncludeWitness && !iter->GetTx ().wit .IsNull ())
369
- continue ;
370
-
371
- // If tx is dependent on other mempool txs which haven't yet been included
372
- // then put it in the waitSet
373
- if (isStillDependent (iter)) {
374
- waitSet.insert (iter);
375
- continue ;
376
- }
377
-
378
- // If the fee rate is below the min fee rate for mining, then we're done
379
- // adding txs based on score (fee rate)
380
- if (iter->GetModifiedFee () < ::minRelayTxFee.GetFee (iter->GetTxSize ()) && nBlockSize >= nBlockMinSize) {
381
- return ;
382
- }
383
-
384
- // If this tx fits in the block add it, otherwise keep looping
385
- if (TestForBlock (iter)) {
386
- AddToBlock (iter);
387
-
388
- // This tx was successfully added, so
389
- // add transactions that depend on this one to the priority queue to try again
390
- BOOST_FOREACH (CTxMemPool::txiter child, mempool.GetMemPoolChildren (iter))
391
- {
392
- if (waitSet.count (child)) {
393
- clearedTxs.push (child);
394
- waitSet.erase (child);
395
- }
396
- }
397
- }
398
- }
399
- }
400
-
401
341
void BlockAssembler::UpdatePackagesForAdded (const CTxMemPool::setEntries& alreadyAdded,
402
342
indexed_modified_transaction_set &mapModifiedTx)
403
343
{
0 commit comments