Skip to content

Commit

Permalink
Reflow comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nbougalis committed Apr 24, 2020
1 parent 2fafd54 commit dc7a01b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
3 changes: 2 additions & 1 deletion src/ripple/app/ledger/impl/LedgerMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ shouldAcquire (
return true;

// Or if greater than or equal to a specific minimum ledger.
return minimumOnline.has_value() && candidateLedger >= *minimumOnline;
return candidateLedger >=
minimumOnline.value_or(std::numeric_limits<LedgerIndex>::max());
}();

JLOG (j.trace())
Expand Down
61 changes: 29 additions & 32 deletions src/ripple/app/misc/SHAMapStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,35 @@ class SHAMapStore
/** Returns the number of file descriptors that are needed. */
virtual int fdRequired() const = 0;

/** If online deletion is enabled, return the minimum ledger
* to keep online, which is the lower bound for attempting to acquire
* historical ledgers over the peer to peer network.
* If online_delete is not enabled, then the minimum value to
* keep online is the minimum ledger that has been persisted already.
*
* With online_delete,this value is governed by the
* following circumstances:
*
* Upon process startup:
*
* With advisory_delete enabled and online_delete having been executed
* previously:
* Upon process startup, this value is set to one past the value
* that is allowed to be deleted. In other words, anything greater
* than what can be deleted should be acquired from the network and
* then retained. If nothing has yet been deleted, then do not
* rely upon the value of what is allowed to be deleted because it
* could cause fetching of more history than configured by
* ledger_history.
*
* Without advisory_delete or if online_delete has never executed:
* Upon process startup, this value is set to the earliest ledger
* that has been persisted in SQLite.
*
* Each time online_delete executes:
*
* Just prior to clearing SQL databases of historical ledgers, move
* the value forward to one past the greatest ledger being deleted.
* This minimizes fetching of ledgers that are in the process of being
* deleted.
*/
/** The minimum ledger to try and maintain in our database.
The defines the lower bound for attempting to acquire historical
ledgers over the peer to peer network.
If online_delete is not enabled, then the minimum value to keep online
is the minimum ledger that has been persisted already.
With online_delete,this value is governed by the following circumstances:
- With advisory_delete enabled and online_delete having been executed
previously this value is set to one past the value that is allowed to
be deleted. In other words, anything greater than what can be deleted
should be acquired from the network and then retained. If nothing has
yet been deleted, then do not rely upon the value of what is allowed
to be deleted because it could cause fetching of more history than
configured by ledger_history.
- Without advisory_delete or if online_delete has never executed, this
value is set to the earliest ledger that has been persisted in SQLite.
Each time online_delete executes, just prior to clearing SQL databases
of historical ledgers, move the value forward to one past the greatest
ledger being deleted. This minimizes fetching of ledgers that are in
the process of being deleted.
@return If online deletion is enabled, the minimum ledger to keep
available; an unseated optional otherwise.
*/
virtual boost::optional<LedgerIndex> minimumOnline() const = 0;
};

Expand Down

0 comments on commit dc7a01b

Please sign in to comment.