mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +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 ledgerHistoryIndex,
|
||||||
std::uint32_t const candidateLedger) const
|
std::uint32_t const candidateLedger) const
|
||||||
{
|
{
|
||||||
bool ret (candidateLedger >= currentLedger ||
|
// If the ledger could be the current ledger acquire it.
|
||||||
candidateLedger > ledgerHistoryIndex ||
|
// Otherwise, acquire it only if it's within our range of
|
||||||
(currentLedger - candidateLedger) <= ledgerHistory);
|
// 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())
|
JLOG (m_journal.trace())
|
||||||
<< "Missing ledger "
|
<< "Missing ledger "
|
||||||
|
|||||||
Reference in New Issue
Block a user