mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 08:13:52 +02: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:
@@ -379,7 +379,7 @@ public:
|
||||
void removeConflicts(const CTransaction& tx) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
bool CompareDepthAndScore(const Wtxid& hasha, const Wtxid& hashb) const;
|
||||
bool CompareMiningScoreWithTopology(const Wtxid& hasha, const Wtxid& hashb) const;
|
||||
bool isSpent(const COutPoint& outpoint) const;
|
||||
unsigned int GetTransactionsUpdated() const;
|
||||
void AddTransactionsUpdated(unsigned int n);
|
||||
|
||||
Reference in New Issue
Block a user