Skip to content

Commit

Permalink
[FOLD] Address feedback from Scott Schurr
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelportilla committed Mar 3, 2021
1 parent 79307f1 commit d134990
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ripple/nodestore/impl/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@ Database::onChildrenStopped()
std::uint32_t
Database::maxLedgers(std::uint32_t shardIndex) const noexcept
{
if (shardIndex > earliestShardIndex_)
return ledgersPerShard_;

if (shardIndex == earliestShardIndex_)
return lastLedgerSeq(shardIndex) - firstLedgerSeq(shardIndex) + 1;

return ledgersPerShard_;
assert(!"Invalid shard index");
return 0;
}

void
Expand Down

0 comments on commit d134990

Please sign in to comment.