mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-02 08:25:55 +00:00
Fix history acquire check (RIPD-1112)
The various history acquire conditions were not combined properly, resulting in historical ledgers being acquired in cases where they should not be.
This commit is contained in:
@@ -1560,9 +1560,12 @@ LedgerMaster::shouldAcquire (
|
||||
std::uint32_t const ledgerHistoryIndex,
|
||||
std::uint32_t const candidateLedger) const
|
||||
{
|
||||
bool ret (candidateLedger >= currentLedger ||
|
||||
candidateLedger > ledgerHistoryIndex ||
|
||||
(currentLedger - candidateLedger) <= ledgerHistory);
|
||||
// If the ledger could be the current ledger acquire it.
|
||||
// Otherwise, acquire it only if it's within our range of
|
||||
// desired history and we wouldn't delete it if we had it.
|
||||
bool ret = (candidateLedger >= currentLedger) ||
|
||||
((candidateLedger >= ledgerHistoryIndex) &&
|
||||
((currentLedger - candidateLedger) <= ledgerHistory));
|
||||
|
||||
JLOG (m_journal.trace())
|
||||
<< "Missing ledger "
|
||||
|
||||
Reference in New Issue
Block a user