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_.deleteInterval)
|
||||||
{
|
{
|
||||||
if (setup_.ledgerHistory > setup_.deleteInterval ||
|
if (setup_.deleteInterval < minimumDeletionInterval_)
|
||||||
setup_.ledgerHistory < minimumDeletionInterval_)
|
|
||||||
{
|
{
|
||||||
std::stringstream es;
|
throw std::runtime_error ("online_delete must be at least " +
|
||||||
es << "online_delete (" << setup_.deleteInterval
|
std::to_string (minimumDeletionInterval_));
|
||||||
<< ") must be at least " << minimumDeletionInterval_
|
}
|
||||||
<< " and cannot be less than LEDGER_HISTORY ("
|
|
||||||
<< setup_.ledgerHistory << ")";
|
if (setup_.ledgerHistory > setup_.deleteInterval)
|
||||||
throw std::runtime_error (es.str());
|
{
|
||||||
|
throw std::runtime_error (
|
||||||
|
"online_delete must be less than ledger_history (currently " +
|
||||||
|
std::to_string (setup_.ledgerHistory) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
state_db_.init (setup_.databasePath, dbName_);
|
state_db_.init (setup_.databasePath, dbName_);
|
||||||
|
|||||||
Reference in New Issue
Block a user