Add config "ledger_history_index" functionality (RIPD-559)

This commit is contained in:
Miguel Portilla
2015-01-07 18:19:55 -05:00
committed by Vinnie Falco
parent 94629edb9b
commit 8b848770dc
8 changed files with 56 additions and 29 deletions

View File

@@ -249,6 +249,7 @@ Config::Config ()
FEE_CONTRACT_OPERATION = DEFAULT_FEE_OPERATION;
LEDGER_HISTORY = 256;
LEDGER_HISTORY_INDEX = 0;
FETCH_DEPTH = 1000000000;
// An explanation of these magical values would be nice.
@@ -584,6 +585,11 @@ void Config::load ()
else
LEDGER_HISTORY = beast::lexicalCastThrow <std::uint32_t> (strTemp);
}
if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY_INDEX, strTemp))
{
LEDGER_HISTORY_INDEX = beast::lexicalCastThrow <std::uint32_t>(strTemp);
}
if (getSingleSection (secConfig, SECTION_FETCH_DEPTH, strTemp))
{
boost::to_lower (strTemp);
@@ -628,7 +634,7 @@ void Config::load ()
}
}
int Config::getSize (SizedItemName item)
int Config::getSize (SizedItemName item) const
{
SizedItem sizeTable[] = // tiny small medium large huge
{