mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Properly validate the configured online delete interval
This commit is contained in:
committed by
Vinnie Falco
parent
15b570bbdd
commit
1af79f7960
@@ -209,15 +209,17 @@ SHAMapStoreImp::SHAMapStoreImp (Setup const& setup,
|
||||
{
|
||||
if (setup_.deleteInterval)
|
||||
{
|
||||
if (setup_.ledgerHistory > setup_.deleteInterval ||
|
||||
setup_.ledgerHistory < minimumDeletionInterval_)
|
||||
if (setup_.deleteInterval < minimumDeletionInterval_)
|
||||
{
|
||||
std::stringstream es;
|
||||
es << "online_delete (" << setup_.deleteInterval
|
||||
<< ") must be at least " << minimumDeletionInterval_
|
||||
<< " and cannot be less than LEDGER_HISTORY ("
|
||||
<< setup_.ledgerHistory << ")";
|
||||
throw std::runtime_error (es.str());
|
||||
throw std::runtime_error ("online_delete must be at least " +
|
||||
std::to_string (minimumDeletionInterval_));
|
||||
}
|
||||
|
||||
if (setup_.ledgerHistory > setup_.deleteInterval)
|
||||
{
|
||||
throw std::runtime_error (
|
||||
"online_delete must be less than ledger_history (currently " +
|
||||
std::to_string (setup_.ledgerHistory) + ")");
|
||||
}
|
||||
|
||||
state_db_.init (setup_.databasePath, dbName_);
|
||||
|
||||
Reference in New Issue
Block a user