[#cluster_linearize-SpanningForestState-GetLinearization]
= xref:cluster_linearize.adoc[cluster&lowbar;linearize]::xref:cluster_linearize/SpanningForestState.adoc[SpanningForestState]::GetLinearization
:relfileprefix: ../../
:mrdocs:

Construct a topologically&hyphen;valid linearization from the current forest state&period; Must be topological&period; fallback&lowbar;order is a comparator that defines a strong order for DepGraphIndexes in this cluster, used to order equal&hyphen;feerate transactions and chunks&period;

== Synopsis

Declared in `&lt;cluster&lowbar;linearize&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::vector&lt;DepGraphIndex&gt;
GetLinearization(auto const& fallback&lowbar;order) noexcept;
----

== Description

Specifically, the resulting order consists of&colon;

* The chunks of the current SFL state, sorted by (in decreasing order of priority)&colon;
* topology (parents before children)
* highest chunk feerate first
* smallest chunk size first
* the chunk with the lowest maximum transaction, by fallback&lowbar;order, first
* The transactions within a chunk, sorted by (in decreasing order of priority)&colon;
* topology (parents before children)
* highest tx feerate first
* smallest tx size first
* the lowest transaction, by fallback&lowbar;order, first

== Return Value

A topologically&hyphen;valid linearization of all transactions&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *fallback&lowbar;order*
| Comparator breaking ties between equal&hyphen;feerate transactions and chunks&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
