@@ -428,6 +428,8 @@ class TxGraphImpl final : public TxGraph
428
428
void ApplyDependencies (int level) noexcept ;
429
429
/* * Make a specified Cluster have quality ACCEPTABLE or OPTIMAL. */
430
430
void MakeAcceptable (Cluster& cluster) noexcept ;
431
+ /* * Make all Clusters at the specified level have quality ACCEPTABLE or OPTIMAL. */
432
+ void MakeAllAcceptable (int level) noexcept ;
431
433
432
434
// Implementations for the public TxGraph interface.
433
435
@@ -436,6 +438,8 @@ class TxGraphImpl final : public TxGraph
436
438
void AddDependency (const Ref& parent, const Ref& child) noexcept final ;
437
439
void SetTransactionFee (const Ref&, int64_t fee) noexcept final ;
438
440
441
+ void DoWork () noexcept final ;
442
+
439
443
void StartStaging () noexcept final ;
440
444
void CommitStaging () noexcept final ;
441
445
void AbortStaging () noexcept final ;
@@ -1370,6 +1374,17 @@ void TxGraphImpl::MakeAcceptable(Cluster& cluster) noexcept
1370
1374
}
1371
1375
}
1372
1376
1377
+ void TxGraphImpl::MakeAllAcceptable (int level) noexcept
1378
+ {
1379
+ ApplyDependencies (level);
1380
+ auto & clusterset = GetClusterSet (level);
1381
+ if (clusterset.m_oversized == true ) return ;
1382
+ auto & queue = clusterset.m_clusters [int (QualityLevel::NEEDS_RELINEARIZE)];
1383
+ while (!queue.empty ()) {
1384
+ MakeAcceptable (*queue.back ().get ());
1385
+ }
1386
+ }
1387
+
1373
1388
Cluster::Cluster (TxGraphImpl& graph, const FeePerWeight& feerate, GraphIndex graph_index) noexcept
1374
1389
{
1375
1390
// Create a new transaction in the DepGraph, and remember its position in m_mapping.
@@ -1942,6 +1957,13 @@ void TxGraphImpl::SanityCheck() const
1942
1957
}
1943
1958
}
1944
1959
1960
+ void TxGraphImpl::DoWork () noexcept
1961
+ {
1962
+ for (int level = 0 ; level <= GetTopLevel (); ++level) {
1963
+ MakeAllAcceptable (level);
1964
+ }
1965
+ }
1966
+
1945
1967
} // namespace
1946
1968
1947
1969
TxGraph::Ref::~Ref ()
0 commit comments