Skip to content

Commit

Permalink
[FOLD] Address ximinez's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelportilla committed Mar 3, 2020
1 parent efba284 commit 94b8241
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 130 deletions.
2 changes: 1 addition & 1 deletion src/ripple/app/ledger/impl/InboundLedger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ InboundLedger::init(ScopedLockType& collectionLock)
if (mFailed)
return;
}
else if (shardStore && mSeq >= shardStore->earliestSeq())
else if (shardStore && mSeq >= shardStore->earliestLedgerSeq())
{
if (auto l = shardStore->fetchLedger(mHash, mSeq))
{
Expand Down
6 changes: 3 additions & 3 deletions src/ripple/app/ledger/impl/LedgerMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ LedgerMaster::fetchForHistory(
*hash, missing, reason);
if (!ledger &&
missing != fetch_seq_ &&
missing > app_.getNodeStore().earliestSeq())
missing > app_.getNodeStore().earliestLedgerSeq())
{
JLOG(m_journal.trace())
<< "fetchForHistory want fetch pack " << missing;
Expand Down Expand Up @@ -1806,7 +1806,7 @@ LedgerMaster::fetchForHistory(
else
// Do not fetch ledger sequences lower
// than the earliest ledger sequence
fetchSz = app_.getNodeStore().earliestSeq();
fetchSz = app_.getNodeStore().earliestLedgerSeq();
fetchSz = missing >= fetchSz ?
std::min(ledger_fetch_size_, (missing - fetchSz) + 1) : 0;
try
Expand Down Expand Up @@ -1866,7 +1866,7 @@ void LedgerMaster::doAdvance (std::unique_lock<std::recursive_mutex>& sl)
std::lock_guard sll(mCompleteLock);
missing = prevMissing(mCompleteLedgers,
mPubLedger->info().seq,
app_.getNodeStore().earliestSeq());
app_.getNodeStore().earliestLedgerSeq());
}
if (missing)
{
Expand Down
6 changes: 3 additions & 3 deletions src/ripple/nodestore/Database.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ class Database : public Stoppable
/** @return The earliest ledger sequence allowed
*/
std::uint32_t
earliestSeq() const
earliestLedgerSeq() const
{
return earliestSeq_;
return earliestLedgerSeq_;
}

protected:
Expand Down Expand Up @@ -285,7 +285,7 @@ class Database : public Stoppable

// The default is 32570 to match the XRP ledger network's earliest
// allowed sequence. Alternate networks may set this value.
std::uint32_t const earliestSeq_;
std::uint32_t const earliestLedgerSeq_;

virtual
std::shared_ptr<NodeObject>
Expand Down
4 changes: 2 additions & 2 deletions src/ripple/nodestore/impl/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Database::Database(
: Stoppable(name, parent.getRoot())
, j_(journal)
, scheduler_(scheduler)
, earliestSeq_(get<std::uint32_t>(
, earliestLedgerSeq_(get<std::uint32_t>(
config,
"earliest_seq",
XRP_LEDGER_EARLIEST_SEQ))
{
if (earliestSeq_ < 1)
if (earliestLedgerSeq_ < 1)
Throw<std::runtime_error>("Invalid earliest_seq");

while (readThreads-- > 0)
Expand Down
Loading

0 comments on commit 94b8241

Please sign in to comment.