mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Make transaction queue order deterministic:
* Sort by fee level (which is the current behavior) then by transaction ID (hash). * Edge case when the account at the end of the queue submits a higher paying transaction to walk backwards and compare against the cheapest transaction from a different account. * Use std::if_any to simplify the JobQueue::isOverloaded loop.
This commit is contained in:
committed by
Nik Bougalis
parent
ae9930b87d
commit
b1c9b134dc
@@ -168,13 +168,9 @@ JobQueue::addLoadEvents(JobType t, int count, std::chrono::milliseconds elapsed)
|
||||
bool
|
||||
JobQueue::isOverloaded()
|
||||
{
|
||||
for (auto& x : m_jobData)
|
||||
{
|
||||
if (x.second.load().isOver())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return std::any_of(m_jobData.begin(), m_jobData.end(), [](auto& entry) {
|
||||
return entry.second.load().isOver();
|
||||
});
|
||||
}
|
||||
|
||||
Json::Value
|
||||
|
||||
Reference in New Issue
Block a user