mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
Use cluster linearization for transaction relay sort order
Previously, transaction batches were first sorted by ancestor count and then feerate, to ensure transactions are announced in a topologically valid order, while prioritizing higher feerate transactions. Ancestor count is a crude topological sort criteria, so replace this with linearization order so that the highest feerate transactions (as would be observed by the mining algorithm) are relayed before lower feerate ones, in a topologically valid way. This also fixes a test that only worked due to the ancestor-count-based sort order.
This commit is contained in:
@@ -5425,8 +5425,8 @@ public:
|
||||
bool operator()(std::set<Wtxid>::iterator a, std::set<Wtxid>::iterator b)
|
||||
{
|
||||
/* As std::make_heap produces a max-heap, we want the entries with the
|
||||
* fewest ancestors/highest fee to sort later. */
|
||||
return m_mempool->CompareDepthAndScore(*b, *a);
|
||||
* higher mining score to sort later. */
|
||||
return m_mempool->CompareMiningScoreWithTopology(*b, *a);
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user