diff --git a/AccountInfo_8cpp_source.html b/AccountInfo_8cpp_source.html index 56b86a2ba0..629d507802 100644 --- a/AccountInfo_8cpp_source.html +++ b/AccountInfo_8cpp_source.html @@ -308,7 +308,7 @@ $(function() {
ripple::RPC::missing_field_error
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:246
ripple::base_uint
Integers of any length that is a multiple of 32-bits.
Definition: base_uint.h:81
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
-
ripple::TxQ::getAccountTxs
std::vector< TxDetails > getAccountTxs(AccountID const &account) const
Returns information about the transactions currently in the queue for the account.
Definition: TxQ.cpp:1775
+
ripple::TxQ::getAccountTxs
std::vector< TxDetails > getAccountTxs(AccountID const &account) const
Returns information about the transactions currently in the queue for the account.
Definition: TxQ.cpp:1773
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:133
ripple::JsonOptions::none
@ none
diff --git a/AccountTx_8cpp_source.html b/AccountTx_8cpp_source.html index 82bac4fe01..9c09add037 100644 --- a/AccountTx_8cpp_source.html +++ b/AccountTx_8cpp_source.html @@ -249,7 +249,7 @@ $(function() {
178  }
179  uLedgerMin = uLedgerMax = ledgerView->info().seq;
180  }
-
181  return RPC::Status::OK;
+
181  return RPC::Status::OK;
182  },
183  *ledgerSpecifier);
184 
@@ -484,7 +484,6 @@ $(function() {
ripple::SQLiteDatabase
Definition: SQLiteDatabase.h:27
ripple::ReadView::info
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
ripple::LedgerMaster::getValidatedRange
bool getValidatedRange(std::uint32_t &minVal, std::uint32_t &maxVal)
Definition: LedgerMaster.cpp:629
-
ripple::RPC::Status::OK
static constexpr Code OK
Definition: Status.h:46
ripple::JsonOptions::include_date
@ include_date
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::RelationalDatabase::txnMetaLedgerType
std::tuple< Blob, Blob, std::uint32_t > txnMetaLedgerType
Definition: RelationalDatabase.h:87
@@ -514,6 +513,7 @@ $(function() {
ripple::getLedgerRange
std::variant< LedgerRange, RPC::Status > getLedgerRange(RPC::Context &context, std::optional< LedgerSpecifier > const &ledgerSpecifier)
Definition: AccountTx.cpp:120
ripple::RelationalDatabase::AccountTxResult::ledgerRange
LedgerRange ledgerRange
Definition: RelationalDatabase.h:109
ripple::base_uint< 256 >
+
ripple::RPC::Status::OK
static constexpr Code OK
Definition: Status.h:46
ripple::rpcSUCCESS
@ rpcSUCCESS
Definition: ErrorCodes.h:44
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
ripple::Config::reporting
bool reporting() const
Definition: Config.h:317
diff --git a/Application_8cpp_source.html b/Application_8cpp_source.html index a540ca9748..3bf3bae5cc 100644 --- a/Application_8cpp_source.html +++ b/Application_8cpp_source.html @@ -2256,7 +2256,7 @@ $(function() {
ripple::ApplicationImp::m_resourceManager
std::unique_ptr< Resource::Manager > m_resourceManager
Definition: Application.cpp:191
ripple::ValidatorKeys::publicKey
PublicKey publicKey
Definition: ValidatorKeys.h:40
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:339
-
ripple::setup_TxQ
TxQ::Setup setup_TxQ(Config const &config)
Build a TxQ::Setup object from application configuration.
Definition: TxQ.cpp:1855
+
ripple::setup_TxQ
TxQ::Setup setup_TxQ(Config const &config)
Build a TxQ::Setup object from application configuration.
Definition: TxQ.cpp:1853
ripple::ApplicationImp::getReportingETL
ReportingETL & getReportingETL() override
Definition: Application.cpp:903
ripple::NodeStore::DummyScheduler
Simple NodeStore Scheduler that just peforms the tasks synchronously.
Definition: DummyScheduler.h:29
ripple::ApplicationImp::getValidationPublicKey
PublicKey const & getValidationPublicKey() const override
Definition: Application.cpp:594
diff --git a/Config_8cpp_source.html b/Config_8cpp_source.html index 109242f8a0..e077e6fef4 100644 --- a/Config_8cpp_source.html +++ b/Config_8cpp_source.html @@ -334,740 +334,738 @@ $(function() {
263  return value;
264 }
265 
-
266 constexpr FeeUnit32 Config::TRANSACTION_FEE_BASE;
-
267 
-
268 Config::Config()
-
269  : j_(beast::Journal::getNullSink()), ramSize_(detail::getMemorySize())
-
270 {
-
271 }
-
272 
-
273 void
-
274 Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone)
-
275 {
-
276  assert(NODE_SIZE == 0);
-
277 
-
278  QUIET = bQuiet || bSilent;
-
279  SILENT = bSilent;
-
280  RUN_STANDALONE = bStandalone;
-
281 
-
282  // We try to autodetect the appropriate node size by checking available
-
283  // RAM and CPU resources. We default to "tiny" for standalone mode.
-
284  if (!bStandalone)
-
285  {
-
286  // First, check against 'minimum' RAM requirements per node size:
-
287  auto const& threshold =
-
288  sizedItems[std::underlying_type_t<SizedItem>(SizedItem::ramSizeGB)];
-
289 
-
290  auto ns = std::find_if(
-
291  threshold.second.begin(),
-
292  threshold.second.end(),
-
293  [this](std::size_t limit) {
-
294  return (ramSize_ / (1024 * 1024 * 1024)) < limit;
-
295  });
-
296 
-
297  if (ns != threshold.second.end())
-
298  NODE_SIZE = std::distance(threshold.second.begin(), ns);
-
299 
-
300  // Adjust the size based on the number of hardware threads of
-
301  // execution available to us:
-
302  if (auto const hc = std::thread::hardware_concurrency())
-
303  {
-
304  if (hc == 1)
-
305  NODE_SIZE = 0;
-
306 
-
307  if (hc < 4)
-
308  NODE_SIZE = std::min<std::size_t>(NODE_SIZE, 1);
-
309  }
-
310  }
-
311 
-
312  assert(NODE_SIZE <= 4);
-
313 }
-
314 
-
315 void
-
316 Config::setup(
-
317  std::string const& strConf,
-
318  bool bQuiet,
-
319  bool bSilent,
-
320  bool bStandalone)
-
321 {
-
322  boost::filesystem::path dataDir;
-
323  std::string strDbPath, strConfFile;
-
324 
-
325  // Determine the config and data directories.
-
326  // If the config file is found in the current working
-
327  // directory, use the current working directory as the
-
328  // config directory and that with "db" as the data
-
329  // directory.
+
266 Config::Config()
+
267  : j_(beast::Journal::getNullSink()), ramSize_(detail::getMemorySize())
+
268 {
+
269 }
+
270 
+
271 void
+
272 Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone)
+
273 {
+
274  assert(NODE_SIZE == 0);
+
275 
+
276  QUIET = bQuiet || bSilent;
+
277  SILENT = bSilent;
+
278  RUN_STANDALONE = bStandalone;
+
279 
+
280  // We try to autodetect the appropriate node size by checking available
+
281  // RAM and CPU resources. We default to "tiny" for standalone mode.
+
282  if (!bStandalone)
+
283  {
+
284  // First, check against 'minimum' RAM requirements per node size:
+
285  auto const& threshold =
+
286  sizedItems[std::underlying_type_t<SizedItem>(SizedItem::ramSizeGB)];
+
287 
+
288  auto ns = std::find_if(
+
289  threshold.second.begin(),
+
290  threshold.second.end(),
+
291  [this](std::size_t limit) {
+
292  return (ramSize_ / (1024 * 1024 * 1024)) < limit;
+
293  });
+
294 
+
295  if (ns != threshold.second.end())
+
296  NODE_SIZE = std::distance(threshold.second.begin(), ns);
+
297 
+
298  // Adjust the size based on the number of hardware threads of
+
299  // execution available to us:
+
300  if (auto const hc = std::thread::hardware_concurrency())
+
301  {
+
302  if (hc == 1)
+
303  NODE_SIZE = 0;
+
304 
+
305  if (hc < 4)
+
306  NODE_SIZE = std::min<std::size_t>(NODE_SIZE, 1);
+
307  }
+
308  }
+
309 
+
310  assert(NODE_SIZE <= 4);
+
311 }
+
312 
+
313 void
+
314 Config::setup(
+
315  std::string const& strConf,
+
316  bool bQuiet,
+
317  bool bSilent,
+
318  bool bStandalone)
+
319 {
+
320  boost::filesystem::path dataDir;
+
321  std::string strDbPath, strConfFile;
+
322 
+
323  // Determine the config and data directories.
+
324  // If the config file is found in the current working
+
325  // directory, use the current working directory as the
+
326  // config directory and that with "db" as the data
+
327  // directory.
+
328 
+
329  setupControl(bQuiet, bSilent, bStandalone);
330 
-
331  setupControl(bQuiet, bSilent, bStandalone);
+
331  strDbPath = databaseDirName;
332 
-
333  strDbPath = databaseDirName;
-
334 
-
335  if (!strConf.empty())
-
336  strConfFile = strConf;
-
337  else
-
338  strConfFile = configFileName;
-
339 
-
340  if (!strConf.empty())
-
341  {
-
342  // --conf=<path> : everything is relative that file.
-
343  CONFIG_FILE = strConfFile;
-
344  CONFIG_DIR = boost::filesystem::absolute(CONFIG_FILE);
-
345  CONFIG_DIR.remove_filename();
-
346  dataDir = CONFIG_DIR / strDbPath;
-
347  }
-
348  else
-
349  {
-
350  CONFIG_DIR = boost::filesystem::current_path();
-
351  CONFIG_FILE = CONFIG_DIR / strConfFile;
-
352  dataDir = CONFIG_DIR / strDbPath;
-
353 
-
354  // Construct XDG config and data home.
-
355  // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
-
356  auto const strHome = getEnvVar("HOME");
-
357  auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME");
-
358  auto strXdgDataHome = getEnvVar("XDG_DATA_HOME");
-
359 
-
360  if (boost::filesystem::exists(CONFIG_FILE)
-
361  // Can we figure out XDG dirs?
-
362  || (strHome.empty() &&
-
363  (strXdgConfigHome.empty() || strXdgDataHome.empty())))
-
364  {
-
365  // Current working directory is fine, put dbs in a subdir.
-
366  }
-
367  else
-
368  {
-
369  if (strXdgConfigHome.empty())
-
370  {
-
371  // $XDG_CONFIG_HOME was not set, use default based on $HOME.
-
372  strXdgConfigHome = strHome + "/.config";
-
373  }
-
374 
-
375  if (strXdgDataHome.empty())
-
376  {
-
377  // $XDG_DATA_HOME was not set, use default based on $HOME.
-
378  strXdgDataHome = strHome + "/.local/share";
-
379  }
-
380 
-
381  CONFIG_DIR = strXdgConfigHome + "/" + systemName();
-
382  CONFIG_FILE = CONFIG_DIR / strConfFile;
-
383  dataDir = strXdgDataHome + "/" + systemName();
-
384 
-
385  if (!boost::filesystem::exists(CONFIG_FILE))
-
386  {
-
387  CONFIG_DIR = "/etc/opt/" + systemName();
-
388  CONFIG_FILE = CONFIG_DIR / strConfFile;
-
389  dataDir = "/var/opt/" + systemName();
-
390  }
-
391  }
-
392  }
-
393 
-
394  // Update default values
-
395  load();
-
396  if (exists("reporting"))
-
397  {
-
398  RUN_REPORTING = true;
-
399  RUN_STANDALONE = true;
-
400  }
-
401  {
-
402  // load() may have set a new value for the dataDir
-
403  std::string const dbPath(legacy("database_path"));
-
404  if (!dbPath.empty())
-
405  dataDir = boost::filesystem::path(dbPath);
-
406  else if (RUN_STANDALONE)
-
407  dataDir.clear();
-
408  }
-
409 
-
410  if (!dataDir.empty())
-
411  {
-
412  boost::system::error_code ec;
-
413  boost::filesystem::create_directories(dataDir, ec);
-
414 
-
415  if (ec)
-
416  Throw<std::runtime_error>(
-
417  boost::str(boost::format("Can not create %s") % dataDir));
-
418 
-
419  legacy("database_path", boost::filesystem::absolute(dataDir).string());
-
420  }
+
333  if (!strConf.empty())
+
334  strConfFile = strConf;
+
335  else
+
336  strConfFile = configFileName;
+
337 
+
338  if (!strConf.empty())
+
339  {
+
340  // --conf=<path> : everything is relative that file.
+
341  CONFIG_FILE = strConfFile;
+
342  CONFIG_DIR = boost::filesystem::absolute(CONFIG_FILE);
+
343  CONFIG_DIR.remove_filename();
+
344  dataDir = CONFIG_DIR / strDbPath;
+
345  }
+
346  else
+
347  {
+
348  CONFIG_DIR = boost::filesystem::current_path();
+
349  CONFIG_FILE = CONFIG_DIR / strConfFile;
+
350  dataDir = CONFIG_DIR / strDbPath;
+
351 
+
352  // Construct XDG config and data home.
+
353  // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+
354  auto const strHome = getEnvVar("HOME");
+
355  auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME");
+
356  auto strXdgDataHome = getEnvVar("XDG_DATA_HOME");
+
357 
+
358  if (boost::filesystem::exists(CONFIG_FILE)
+
359  // Can we figure out XDG dirs?
+
360  || (strHome.empty() &&
+
361  (strXdgConfigHome.empty() || strXdgDataHome.empty())))
+
362  {
+
363  // Current working directory is fine, put dbs in a subdir.
+
364  }
+
365  else
+
366  {
+
367  if (strXdgConfigHome.empty())
+
368  {
+
369  // $XDG_CONFIG_HOME was not set, use default based on $HOME.
+
370  strXdgConfigHome = strHome + "/.config";
+
371  }
+
372 
+
373  if (strXdgDataHome.empty())
+
374  {
+
375  // $XDG_DATA_HOME was not set, use default based on $HOME.
+
376  strXdgDataHome = strHome + "/.local/share";
+
377  }
+
378 
+
379  CONFIG_DIR = strXdgConfigHome + "/" + systemName();
+
380  CONFIG_FILE = CONFIG_DIR / strConfFile;
+
381  dataDir = strXdgDataHome + "/" + systemName();
+
382 
+
383  if (!boost::filesystem::exists(CONFIG_FILE))
+
384  {
+
385  CONFIG_DIR = "/etc/opt/" + systemName();
+
386  CONFIG_FILE = CONFIG_DIR / strConfFile;
+
387  dataDir = "/var/opt/" + systemName();
+
388  }
+
389  }
+
390  }
+
391 
+
392  // Update default values
+
393  load();
+
394  if (exists("reporting"))
+
395  {
+
396  RUN_REPORTING = true;
+
397  RUN_STANDALONE = true;
+
398  }
+
399  {
+
400  // load() may have set a new value for the dataDir
+
401  std::string const dbPath(legacy("database_path"));
+
402  if (!dbPath.empty())
+
403  dataDir = boost::filesystem::path(dbPath);
+
404  else if (RUN_STANDALONE)
+
405  dataDir.clear();
+
406  }
+
407 
+
408  if (!dataDir.empty())
+
409  {
+
410  boost::system::error_code ec;
+
411  boost::filesystem::create_directories(dataDir, ec);
+
412 
+
413  if (ec)
+
414  Throw<std::runtime_error>(
+
415  boost::str(boost::format("Can not create %s") % dataDir));
+
416 
+
417  legacy("database_path", boost::filesystem::absolute(dataDir).string());
+
418  }
+
419 
+
420  HTTPClient::initializeSSLContext(*this, j_);
421 
-
422  HTTPClient::initializeSSLContext(*this, j_);
-
423 
-
424  if (RUN_STANDALONE)
-
425  LEDGER_HISTORY = 0;
-
426 
-
427  std::string ledgerTxDbType;
-
428  Section ledgerTxTablesSection = section("ledger_tx_tables");
-
429  get_if_exists(ledgerTxTablesSection, "use_tx_tables", USE_TX_TABLES);
-
430 
-
431  Section& nodeDbSection{section(ConfigSection::nodeDatabase())};
-
432  get_if_exists(nodeDbSection, "fast_load", FAST_LOAD);
-
433 }
-
434 
-
435 void
-
436 Config::load()
-
437 {
-
438  // NOTE: this writes to cerr because we want cout to be reserved
-
439  // for the writing of the json response (so that stdout can be part of a
-
440  // pipeline, for instance)
-
441  if (!QUIET)
-
442  std::cerr << "Loading: " << CONFIG_FILE << "\n";
-
443 
-
444  boost::system::error_code ec;
-
445  auto const fileContents = getFileContents(ec, CONFIG_FILE);
-
446 
-
447  if (ec)
-
448  {
-
449  std::cerr << "Failed to read '" << CONFIG_FILE << "'." << ec.value()
-
450  << ": " << ec.message() << std::endl;
-
451  return;
-
452  }
-
453 
-
454  loadFromString(fileContents);
-
455 }
-
456 
-
457 void
-
458 Config::loadFromString(std::string const& fileContents)
-
459 {
-
460  IniFileSections secConfig = parseIniFile(fileContents, true);
+
422  if (RUN_STANDALONE)
+
423  LEDGER_HISTORY = 0;
+
424 
+
425  std::string ledgerTxDbType;
+
426  Section ledgerTxTablesSection = section("ledger_tx_tables");
+
427  get_if_exists(ledgerTxTablesSection, "use_tx_tables", USE_TX_TABLES);
+
428 
+
429  Section& nodeDbSection{section(ConfigSection::nodeDatabase())};
+
430  get_if_exists(nodeDbSection, "fast_load", FAST_LOAD);
+
431 }
+
432 
+
433 void
+
434 Config::load()
+
435 {
+
436  // NOTE: this writes to cerr because we want cout to be reserved
+
437  // for the writing of the json response (so that stdout can be part of a
+
438  // pipeline, for instance)
+
439  if (!QUIET)
+
440  std::cerr << "Loading: " << CONFIG_FILE << "\n";
+
441 
+
442  boost::system::error_code ec;
+
443  auto const fileContents = getFileContents(ec, CONFIG_FILE);
+
444 
+
445  if (ec)
+
446  {
+
447  std::cerr << "Failed to read '" << CONFIG_FILE << "'." << ec.value()
+
448  << ": " << ec.message() << std::endl;
+
449  return;
+
450  }
+
451 
+
452  loadFromString(fileContents);
+
453 }
+
454 
+
455 void
+
456 Config::loadFromString(std::string const& fileContents)
+
457 {
+
458  IniFileSections secConfig = parseIniFile(fileContents, true);
+
459 
+
460  build(secConfig);
461 
-
462  build(secConfig);
-
463 
-
464  if (auto s = getIniFileSection(secConfig, SECTION_IPS))
-
465  IPS = *s;
-
466 
-
467  if (auto s = getIniFileSection(secConfig, SECTION_IPS_FIXED))
-
468  IPS_FIXED = *s;
-
469 
-
470  if (auto s = getIniFileSection(secConfig, SECTION_SNTP))
-
471  SNTP_SERVERS = *s;
-
472 
-
473  {
-
474  std::string dbPath;
-
475  if (getSingleSection(secConfig, "database_path", dbPath, j_))
-
476  {
-
477  boost::filesystem::path p(dbPath);
-
478  legacy("database_path", boost::filesystem::absolute(p).string());
-
479  }
-
480  }
+
462  if (auto s = getIniFileSection(secConfig, SECTION_IPS))
+
463  IPS = *s;
+
464 
+
465  if (auto s = getIniFileSection(secConfig, SECTION_IPS_FIXED))
+
466  IPS_FIXED = *s;
+
467 
+
468  if (auto s = getIniFileSection(secConfig, SECTION_SNTP))
+
469  SNTP_SERVERS = *s;
+
470 
+
471  {
+
472  std::string dbPath;
+
473  if (getSingleSection(secConfig, "database_path", dbPath, j_))
+
474  {
+
475  boost::filesystem::path p(dbPath);
+
476  legacy("database_path", boost::filesystem::absolute(p).string());
+
477  }
+
478  }
+
479 
+
480  std::string strTemp;
481 
-
482  std::string strTemp;
-
483 
-
484  if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
-
485  PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
-
486 
-
487  if (getSingleSection(secConfig, SECTION_PEERS_MAX, strTemp, j_))
-
488  {
-
489  PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
-
490  }
-
491  else
-
492  {
-
493  std::optional<std::size_t> peers_in_max{};
-
494  if (getSingleSection(secConfig, SECTION_PEERS_IN_MAX, strTemp, j_))
-
495  {
-
496  peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
497  if (*peers_in_max > 1000)
-
498  Throw<std::runtime_error>(
-
499  "Invalid value specified in [" SECTION_PEERS_IN_MAX
-
500  "] section; the value must be less or equal than 1000");
-
501  }
-
502 
-
503  std::optional<std::size_t> peers_out_max{};
-
504  if (getSingleSection(secConfig, SECTION_PEERS_OUT_MAX, strTemp, j_))
-
505  {
-
506  peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
507  if (*peers_out_max < 10 || *peers_out_max > 1000)
-
508  Throw<std::runtime_error>(
-
509  "Invalid value specified in [" SECTION_PEERS_OUT_MAX
-
510  "] section; the value must be in range 10-1000");
-
511  }
-
512 
-
513  // if one section is configured then the other must be configured too
-
514  if ((peers_in_max && !peers_out_max) ||
-
515  (peers_out_max && !peers_in_max))
-
516  Throw<std::runtime_error>("Both sections [" SECTION_PEERS_IN_MAX
-
517  "]"
-
518  "and [" SECTION_PEERS_OUT_MAX
-
519  "] must be configured");
-
520 
-
521  if (peers_in_max && peers_out_max)
-
522  {
-
523  PEERS_IN_MAX = *peers_in_max;
-
524  PEERS_OUT_MAX = *peers_out_max;
-
525  }
-
526  }
-
527 
-
528  if (getSingleSection(secConfig, SECTION_NODE_SIZE, strTemp, j_))
-
529  {
-
530  if (boost::iequals(strTemp, "tiny"))
-
531  NODE_SIZE = 0;
-
532  else if (boost::iequals(strTemp, "small"))
-
533  NODE_SIZE = 1;
-
534  else if (boost::iequals(strTemp, "medium"))
-
535  NODE_SIZE = 2;
-
536  else if (boost::iequals(strTemp, "large"))
-
537  NODE_SIZE = 3;
-
538  else if (boost::iequals(strTemp, "huge"))
-
539  NODE_SIZE = 4;
-
540  else
-
541  NODE_SIZE = std::min<std::size_t>(
-
542  4, beast::lexicalCastThrow<std::size_t>(strTemp));
-
543  }
-
544 
-
545  if (getSingleSection(secConfig, SECTION_SIGNING_SUPPORT, strTemp, j_))
-
546  signingEnabled_ = beast::lexicalCastThrow<bool>(strTemp);
-
547 
-
548  if (getSingleSection(secConfig, SECTION_ELB_SUPPORT, strTemp, j_))
-
549  ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
-
550 
-
551  getSingleSection(secConfig, SECTION_SSL_VERIFY_FILE, SSL_VERIFY_FILE, j_);
-
552  getSingleSection(secConfig, SECTION_SSL_VERIFY_DIR, SSL_VERIFY_DIR, j_);
-
553 
-
554  if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
-
555  SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
-
556 
-
557  if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
-
558  {
-
559  if (boost::iequals(strTemp, "all"))
-
560  RELAY_UNTRUSTED_VALIDATIONS = 1;
-
561  else if (boost::iequals(strTemp, "trusted"))
-
562  RELAY_UNTRUSTED_VALIDATIONS = 0;
-
563  else if (boost::iequals(strTemp, "drop_untrusted"))
-
564  RELAY_UNTRUSTED_VALIDATIONS = -1;
-
565  else
-
566  Throw<std::runtime_error>(
-
567  "Invalid value specified in [" SECTION_RELAY_VALIDATIONS
-
568  "] section");
-
569  }
-
570 
-
571  if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
-
572  {
-
573  if (boost::iequals(strTemp, "all"))
-
574  RELAY_UNTRUSTED_PROPOSALS = 1;
-
575  else if (boost::iequals(strTemp, "trusted"))
-
576  RELAY_UNTRUSTED_PROPOSALS = 0;
-
577  else if (boost::iequals(strTemp, "drop_untrusted"))
-
578  RELAY_UNTRUSTED_PROPOSALS = -1;
-
579  else
-
580  Throw<std::runtime_error>(
-
581  "Invalid value specified in [" SECTION_RELAY_PROPOSALS
-
582  "] section");
-
583  }
-
584 
-
585  if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
-
586  Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED
-
587  "] and [" SECTION_VALIDATOR_TOKEN
-
588  "] config sections");
-
589 
-
590  if (getSingleSection(secConfig, SECTION_NETWORK_QUORUM, strTemp, j_))
-
591  NETWORK_QUORUM = beast::lexicalCastThrow<std::size_t>(strTemp);
-
592 
-
593  if (getSingleSection(secConfig, SECTION_FEE_ACCOUNT_RESERVE, strTemp, j_))
-
594  FEE_ACCOUNT_RESERVE = beast::lexicalCastThrow<std::uint64_t>(strTemp);
-
595 
-
596  if (getSingleSection(secConfig, SECTION_FEE_OWNER_RESERVE, strTemp, j_))
-
597  FEE_OWNER_RESERVE = beast::lexicalCastThrow<std::uint64_t>(strTemp);
-
598 
-
599  if (getSingleSection(secConfig, SECTION_FEE_DEFAULT, strTemp, j_))
-
600  FEE_DEFAULT = beast::lexicalCastThrow<std::uint64_t>(strTemp);
-
601 
-
602  if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY, strTemp, j_))
-
603  {
-
604  if (boost::iequals(strTemp, "full"))
-
605  LEDGER_HISTORY =
-
606  std::numeric_limits<decltype(LEDGER_HISTORY)>::max();
-
607  else if (boost::iequals(strTemp, "none"))
-
608  LEDGER_HISTORY = 0;
-
609  else
-
610  LEDGER_HISTORY = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
611  }
-
612 
-
613  if (getSingleSection(secConfig, SECTION_FETCH_DEPTH, strTemp, j_))
-
614  {
-
615  if (boost::iequals(strTemp, "none"))
-
616  FETCH_DEPTH = 0;
-
617  else if (boost::iequals(strTemp, "full"))
-
618  FETCH_DEPTH = std::numeric_limits<decltype(FETCH_DEPTH)>::max();
-
619  else
-
620  FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
621 
-
622  if (FETCH_DEPTH < 10)
-
623  FETCH_DEPTH = 10;
-
624  }
-
625 
-
626  // By default, validators don't have pathfinding enabled, unless it is
-
627  // explicitly requested by the server's admin.
-
628  if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
-
629  PATH_SEARCH_MAX = 0;
-
630 
-
631  if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
-
632  PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
-
633  if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
-
634  PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
-
635  if (getSingleSection(secConfig, SECTION_PATH_SEARCH_FAST, strTemp, j_))
-
636  PATH_SEARCH_FAST = beast::lexicalCastThrow<int>(strTemp);
-
637  if (getSingleSection(secConfig, SECTION_PATH_SEARCH_MAX, strTemp, j_))
-
638  PATH_SEARCH_MAX = beast::lexicalCastThrow<int>(strTemp);
-
639 
-
640  if (getSingleSection(secConfig, SECTION_DEBUG_LOGFILE, strTemp, j_))
-
641  DEBUG_LOGFILE = strTemp;
-
642 
-
643  if (getSingleSection(secConfig, SECTION_SWEEP_INTERVAL, strTemp, j_))
-
644  {
-
645  SWEEP_INTERVAL = beast::lexicalCastThrow<std::size_t>(strTemp);
-
646 
-
647  if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
-
648  Throw<std::runtime_error>("Invalid " SECTION_SWEEP_INTERVAL
-
649  ": must be between 10 and 600 inclusive");
-
650  }
-
651 
-
652  if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
-
653  {
-
654  WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
655 
-
656  if (WORKERS < 1 || WORKERS > 1024)
-
657  Throw<std::runtime_error>(
-
658  "Invalid " SECTION_WORKERS
-
659  ": must be between 1 and 1024 inclusive.");
-
660  }
-
661 
-
662  if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
-
663  {
-
664  IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
665 
-
666  if (IO_WORKERS < 1 || IO_WORKERS > 1024)
-
667  Throw<std::runtime_error>(
-
668  "Invalid " SECTION_IO_WORKERS
-
669  ": must be between 1 and 1024 inclusive.");
-
670  }
-
671 
-
672  if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
-
673  {
-
674  PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
675 
-
676  if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
-
677  Throw<std::runtime_error>(
-
678  "Invalid " SECTION_PREFETCH_WORKERS
-
679  ": must be between 1 and 1024 inclusive.");
-
680  }
-
681 
-
682  if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
-
683  COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
-
684 
-
685  if (getSingleSection(secConfig, SECTION_LEDGER_REPLAY, strTemp, j_))
-
686  LEDGER_REPLAY = beast::lexicalCastThrow<bool>(strTemp);
-
687 
-
688  if (exists(SECTION_REDUCE_RELAY))
-
689  {
-
690  auto sec = section(SECTION_REDUCE_RELAY);
-
691  VP_REDUCE_RELAY_ENABLE = sec.value_or("vp_enable", false);
-
692  VP_REDUCE_RELAY_SQUELCH = sec.value_or("vp_squelch", false);
-
693  TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
-
694  TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
-
695  TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
-
696  TX_RELAY_PERCENTAGE = sec.value_or("tx_relay_percentage", 25);
-
697  if (TX_RELAY_PERCENTAGE < 10 || TX_RELAY_PERCENTAGE > 100 ||
-
698  TX_REDUCE_RELAY_MIN_PEERS < 10)
-
699  Throw<std::runtime_error>(
-
700  "Invalid " SECTION_REDUCE_RELAY
-
701  ", tx_min_peers must be greater or equal to 10"
-
702  ", tx_relay_percentage must be greater or equal to 10 "
-
703  "and less or equal to 100");
-
704  }
-
705 
-
706  if (getSingleSection(secConfig, SECTION_MAX_TRANSACTIONS, strTemp, j_))
-
707  {
-
708  MAX_TRANSACTIONS = std::clamp(
-
709  beast::lexicalCastThrow<int>(strTemp),
-
710  MIN_JOB_QUEUE_TX,
-
711  MAX_JOB_QUEUE_TX);
-
712  }
-
713 
-
714  if (getSingleSection(secConfig, SECTION_SERVER_DOMAIN, strTemp, j_))
-
715  {
-
716  if (!isProperlyFormedTomlDomain(strTemp))
-
717  {
-
718  Throw<std::runtime_error>(
-
719  "Invalid " SECTION_SERVER_DOMAIN
-
720  ": the domain name does not appear to meet the requirements.");
-
721  }
-
722 
-
723  SERVER_DOMAIN = strTemp;
-
724  }
-
725 
-
726  if (exists(SECTION_OVERLAY))
-
727  {
-
728  auto const sec = section(SECTION_OVERLAY);
+
482  if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
+
483  PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
+
484 
+
485  if (getSingleSection(secConfig, SECTION_PEERS_MAX, strTemp, j_))
+
486  {
+
487  PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
+
488  }
+
489  else
+
490  {
+
491  std::optional<std::size_t> peers_in_max{};
+
492  if (getSingleSection(secConfig, SECTION_PEERS_IN_MAX, strTemp, j_))
+
493  {
+
494  peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
495  if (*peers_in_max > 1000)
+
496  Throw<std::runtime_error>(
+
497  "Invalid value specified in [" SECTION_PEERS_IN_MAX
+
498  "] section; the value must be less or equal than 1000");
+
499  }
+
500 
+
501  std::optional<std::size_t> peers_out_max{};
+
502  if (getSingleSection(secConfig, SECTION_PEERS_OUT_MAX, strTemp, j_))
+
503  {
+
504  peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
505  if (*peers_out_max < 10 || *peers_out_max > 1000)
+
506  Throw<std::runtime_error>(
+
507  "Invalid value specified in [" SECTION_PEERS_OUT_MAX
+
508  "] section; the value must be in range 10-1000");
+
509  }
+
510 
+
511  // if one section is configured then the other must be configured too
+
512  if ((peers_in_max && !peers_out_max) ||
+
513  (peers_out_max && !peers_in_max))
+
514  Throw<std::runtime_error>("Both sections [" SECTION_PEERS_IN_MAX
+
515  "]"
+
516  "and [" SECTION_PEERS_OUT_MAX
+
517  "] must be configured");
+
518 
+
519  if (peers_in_max && peers_out_max)
+
520  {
+
521  PEERS_IN_MAX = *peers_in_max;
+
522  PEERS_OUT_MAX = *peers_out_max;
+
523  }
+
524  }
+
525 
+
526  if (getSingleSection(secConfig, SECTION_NODE_SIZE, strTemp, j_))
+
527  {
+
528  if (boost::iequals(strTemp, "tiny"))
+
529  NODE_SIZE = 0;
+
530  else if (boost::iequals(strTemp, "small"))
+
531  NODE_SIZE = 1;
+
532  else if (boost::iequals(strTemp, "medium"))
+
533  NODE_SIZE = 2;
+
534  else if (boost::iequals(strTemp, "large"))
+
535  NODE_SIZE = 3;
+
536  else if (boost::iequals(strTemp, "huge"))
+
537  NODE_SIZE = 4;
+
538  else
+
539  NODE_SIZE = std::min<std::size_t>(
+
540  4, beast::lexicalCastThrow<std::size_t>(strTemp));
+
541  }
+
542 
+
543  if (getSingleSection(secConfig, SECTION_SIGNING_SUPPORT, strTemp, j_))
+
544  signingEnabled_ = beast::lexicalCastThrow<bool>(strTemp);
+
545 
+
546  if (getSingleSection(secConfig, SECTION_ELB_SUPPORT, strTemp, j_))
+
547  ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
+
548 
+
549  getSingleSection(secConfig, SECTION_SSL_VERIFY_FILE, SSL_VERIFY_FILE, j_);
+
550  getSingleSection(secConfig, SECTION_SSL_VERIFY_DIR, SSL_VERIFY_DIR, j_);
+
551 
+
552  if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
+
553  SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
+
554 
+
555  if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
+
556  {
+
557  if (boost::iequals(strTemp, "all"))
+
558  RELAY_UNTRUSTED_VALIDATIONS = 1;
+
559  else if (boost::iequals(strTemp, "trusted"))
+
560  RELAY_UNTRUSTED_VALIDATIONS = 0;
+
561  else if (boost::iequals(strTemp, "drop_untrusted"))
+
562  RELAY_UNTRUSTED_VALIDATIONS = -1;
+
563  else
+
564  Throw<std::runtime_error>(
+
565  "Invalid value specified in [" SECTION_RELAY_VALIDATIONS
+
566  "] section");
+
567  }
+
568 
+
569  if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
+
570  {
+
571  if (boost::iequals(strTemp, "all"))
+
572  RELAY_UNTRUSTED_PROPOSALS = 1;
+
573  else if (boost::iequals(strTemp, "trusted"))
+
574  RELAY_UNTRUSTED_PROPOSALS = 0;
+
575  else if (boost::iequals(strTemp, "drop_untrusted"))
+
576  RELAY_UNTRUSTED_PROPOSALS = -1;
+
577  else
+
578  Throw<std::runtime_error>(
+
579  "Invalid value specified in [" SECTION_RELAY_PROPOSALS
+
580  "] section");
+
581  }
+
582 
+
583  if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
+
584  Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED
+
585  "] and [" SECTION_VALIDATOR_TOKEN
+
586  "] config sections");
+
587 
+
588  if (getSingleSection(secConfig, SECTION_NETWORK_QUORUM, strTemp, j_))
+
589  NETWORK_QUORUM = beast::lexicalCastThrow<std::size_t>(strTemp);
+
590 
+
591  if (getSingleSection(secConfig, SECTION_FEE_ACCOUNT_RESERVE, strTemp, j_))
+
592  FEE_ACCOUNT_RESERVE = beast::lexicalCastThrow<std::uint64_t>(strTemp);
+
593 
+
594  if (getSingleSection(secConfig, SECTION_FEE_OWNER_RESERVE, strTemp, j_))
+
595  FEE_OWNER_RESERVE = beast::lexicalCastThrow<std::uint64_t>(strTemp);
+
596 
+
597  if (getSingleSection(secConfig, SECTION_FEE_DEFAULT, strTemp, j_))
+
598  FEE_DEFAULT = beast::lexicalCastThrow<std::uint64_t>(strTemp);
+
599 
+
600  if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY, strTemp, j_))
+
601  {
+
602  if (boost::iequals(strTemp, "full"))
+
603  LEDGER_HISTORY =
+
604  std::numeric_limits<decltype(LEDGER_HISTORY)>::max();
+
605  else if (boost::iequals(strTemp, "none"))
+
606  LEDGER_HISTORY = 0;
+
607  else
+
608  LEDGER_HISTORY = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
609  }
+
610 
+
611  if (getSingleSection(secConfig, SECTION_FETCH_DEPTH, strTemp, j_))
+
612  {
+
613  if (boost::iequals(strTemp, "none"))
+
614  FETCH_DEPTH = 0;
+
615  else if (boost::iequals(strTemp, "full"))
+
616  FETCH_DEPTH = std::numeric_limits<decltype(FETCH_DEPTH)>::max();
+
617  else
+
618  FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
619 
+
620  if (FETCH_DEPTH < 10)
+
621  FETCH_DEPTH = 10;
+
622  }
+
623 
+
624  // By default, validators don't have pathfinding enabled, unless it is
+
625  // explicitly requested by the server's admin.
+
626  if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
+
627  PATH_SEARCH_MAX = 0;
+
628 
+
629  if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
+
630  PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
+
631  if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
+
632  PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
+
633  if (getSingleSection(secConfig, SECTION_PATH_SEARCH_FAST, strTemp, j_))
+
634  PATH_SEARCH_FAST = beast::lexicalCastThrow<int>(strTemp);
+
635  if (getSingleSection(secConfig, SECTION_PATH_SEARCH_MAX, strTemp, j_))
+
636  PATH_SEARCH_MAX = beast::lexicalCastThrow<int>(strTemp);
+
637 
+
638  if (getSingleSection(secConfig, SECTION_DEBUG_LOGFILE, strTemp, j_))
+
639  DEBUG_LOGFILE = strTemp;
+
640 
+
641  if (getSingleSection(secConfig, SECTION_SWEEP_INTERVAL, strTemp, j_))
+
642  {
+
643  SWEEP_INTERVAL = beast::lexicalCastThrow<std::size_t>(strTemp);
+
644 
+
645  if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
+
646  Throw<std::runtime_error>("Invalid " SECTION_SWEEP_INTERVAL
+
647  ": must be between 10 and 600 inclusive");
+
648  }
+
649 
+
650  if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
+
651  {
+
652  WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
653 
+
654  if (WORKERS < 1 || WORKERS > 1024)
+
655  Throw<std::runtime_error>(
+
656  "Invalid " SECTION_WORKERS
+
657  ": must be between 1 and 1024 inclusive.");
+
658  }
+
659 
+
660  if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
+
661  {
+
662  IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
663 
+
664  if (IO_WORKERS < 1 || IO_WORKERS > 1024)
+
665  Throw<std::runtime_error>(
+
666  "Invalid " SECTION_IO_WORKERS
+
667  ": must be between 1 and 1024 inclusive.");
+
668  }
+
669 
+
670  if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
+
671  {
+
672  PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
673 
+
674  if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
+
675  Throw<std::runtime_error>(
+
676  "Invalid " SECTION_PREFETCH_WORKERS
+
677  ": must be between 1 and 1024 inclusive.");
+
678  }
+
679 
+
680  if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
+
681  COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
+
682 
+
683  if (getSingleSection(secConfig, SECTION_LEDGER_REPLAY, strTemp, j_))
+
684  LEDGER_REPLAY = beast::lexicalCastThrow<bool>(strTemp);
+
685 
+
686  if (exists(SECTION_REDUCE_RELAY))
+
687  {
+
688  auto sec = section(SECTION_REDUCE_RELAY);
+
689  VP_REDUCE_RELAY_ENABLE = sec.value_or("vp_enable", false);
+
690  VP_REDUCE_RELAY_SQUELCH = sec.value_or("vp_squelch", false);
+
691  TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
+
692  TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
+
693  TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
+
694  TX_RELAY_PERCENTAGE = sec.value_or("tx_relay_percentage", 25);
+
695  if (TX_RELAY_PERCENTAGE < 10 || TX_RELAY_PERCENTAGE > 100 ||
+
696  TX_REDUCE_RELAY_MIN_PEERS < 10)
+
697  Throw<std::runtime_error>(
+
698  "Invalid " SECTION_REDUCE_RELAY
+
699  ", tx_min_peers must be greater or equal to 10"
+
700  ", tx_relay_percentage must be greater or equal to 10 "
+
701  "and less or equal to 100");
+
702  }
+
703 
+
704  if (getSingleSection(secConfig, SECTION_MAX_TRANSACTIONS, strTemp, j_))
+
705  {
+
706  MAX_TRANSACTIONS = std::clamp(
+
707  beast::lexicalCastThrow<int>(strTemp),
+
708  MIN_JOB_QUEUE_TX,
+
709  MAX_JOB_QUEUE_TX);
+
710  }
+
711 
+
712  if (getSingleSection(secConfig, SECTION_SERVER_DOMAIN, strTemp, j_))
+
713  {
+
714  if (!isProperlyFormedTomlDomain(strTemp))
+
715  {
+
716  Throw<std::runtime_error>(
+
717  "Invalid " SECTION_SERVER_DOMAIN
+
718  ": the domain name does not appear to meet the requirements.");
+
719  }
+
720 
+
721  SERVER_DOMAIN = strTemp;
+
722  }
+
723 
+
724  if (exists(SECTION_OVERLAY))
+
725  {
+
726  auto const sec = section(SECTION_OVERLAY);
+
727 
+
728  using namespace std::chrono;
729 
-
730  using namespace std::chrono;
-
731 
-
732  try
-
733  {
-
734  if (auto val = sec.get("max_unknown_time"))
-
735  MAX_UNKNOWN_TIME =
-
736  seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
-
737  }
-
738  catch (...)
-
739  {
-
740  Throw<std::runtime_error>(
-
741  "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
742  ": must be of the form '<number>' representing seconds.");
-
743  }
-
744 
-
745  if (MAX_UNKNOWN_TIME < seconds{300} || MAX_UNKNOWN_TIME > seconds{1800})
-
746  Throw<std::runtime_error>(
-
747  "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
748  ": the time must be between 300 and 1800 seconds, inclusive.");
-
749 
-
750  try
-
751  {
-
752  if (auto val = sec.get("max_diverged_time"))
-
753  MAX_DIVERGED_TIME =
-
754  seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
-
755  }
-
756  catch (...)
-
757  {
-
758  Throw<std::runtime_error>(
-
759  "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
760  ": must be of the form '<number>' representing seconds.");
-
761  }
-
762 
-
763  if (MAX_DIVERGED_TIME < seconds{60} || MAX_DIVERGED_TIME > seconds{900})
-
764  {
-
765  Throw<std::runtime_error>(
-
766  "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
767  ": the time must be between 60 and 900 seconds, inclusive.");
-
768  }
-
769  }
-
770 
-
771  if (getSingleSection(
-
772  secConfig, SECTION_AMENDMENT_MAJORITY_TIME, strTemp, j_))
-
773  {
-
774  using namespace std::chrono;
-
775  boost::regex const re(
-
776  "^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
-
777  boost::smatch match;
-
778  if (!boost::regex_match(strTemp, match, re))
-
779  Throw<std::runtime_error>(
-
780  "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
781  ", must be: [0-9]+ [minutes|hours|days|weeks]");
-
782 
-
783  std::uint32_t duration =
-
784  beast::lexicalCastThrow<std::uint32_t>(match[1].str());
-
785 
-
786  if (boost::iequals(match[2], "minutes"))
-
787  AMENDMENT_MAJORITY_TIME = minutes(duration);
-
788  else if (boost::iequals(match[2], "hours"))
-
789  AMENDMENT_MAJORITY_TIME = hours(duration);
-
790  else if (boost::iequals(match[2], "days"))
-
791  AMENDMENT_MAJORITY_TIME = days(duration);
-
792  else if (boost::iequals(match[2], "weeks"))
-
793  AMENDMENT_MAJORITY_TIME = weeks(duration);
-
794 
-
795  if (AMENDMENT_MAJORITY_TIME < minutes(15))
-
796  Throw<std::runtime_error>(
-
797  "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
798  ", the minimum amount of time an amendment must hold a "
-
799  "majority is 15 minutes");
-
800  }
-
801 
-
802  if (getSingleSection(secConfig, SECTION_BETA_RPC_API, strTemp, j_))
-
803  BETA_RPC_API = beast::lexicalCastThrow<bool>(strTemp);
-
804 
-
805  // Do not load trusted validator configuration for standalone mode
-
806  if (!RUN_STANDALONE)
-
807  {
-
808  // If a file was explicitly specified, then throw if the
-
809  // path is malformed or if the file does not exist or is
-
810  // not a file.
-
811  // If the specified file is not an absolute path, then look
-
812  // for it in the same directory as the config file.
-
813  // If no path was specified, then look for validators.txt
-
814  // in the same directory as the config file, but don't complain
-
815  // if we can't find it.
-
816  boost::filesystem::path validatorsFile;
-
817 
-
818  if (getSingleSection(secConfig, SECTION_VALIDATORS_FILE, strTemp, j_))
-
819  {
-
820  validatorsFile = strTemp;
-
821 
-
822  if (validatorsFile.empty())
-
823  Throw<std::runtime_error>(
-
824  "Invalid path specified in [" SECTION_VALIDATORS_FILE "]");
-
825 
-
826  if (!validatorsFile.is_absolute() && !CONFIG_DIR.empty())
-
827  validatorsFile = CONFIG_DIR / validatorsFile;
-
828 
-
829  if (!boost::filesystem::exists(validatorsFile))
-
830  Throw<std::runtime_error>(
-
831  "The file specified in [" SECTION_VALIDATORS_FILE
-
832  "] "
-
833  "does not exist: " +
-
834  validatorsFile.string());
-
835 
-
836  else if (
-
837  !boost::filesystem::is_regular_file(validatorsFile) &&
-
838  !boost::filesystem::is_symlink(validatorsFile))
-
839  Throw<std::runtime_error>(
-
840  "Invalid file specified in [" SECTION_VALIDATORS_FILE
-
841  "]: " +
-
842  validatorsFile.string());
-
843  }
-
844  else if (!CONFIG_DIR.empty())
-
845  {
-
846  validatorsFile = CONFIG_DIR / validatorsFileName;
-
847 
-
848  if (!validatorsFile.empty())
-
849  {
-
850  if (!boost::filesystem::exists(validatorsFile))
-
851  validatorsFile.clear();
-
852  else if (
-
853  !boost::filesystem::is_regular_file(validatorsFile) &&
-
854  !boost::filesystem::is_symlink(validatorsFile))
-
855  validatorsFile.clear();
-
856  }
-
857  }
-
858 
-
859  if (!validatorsFile.empty() &&
-
860  boost::filesystem::exists(validatorsFile) &&
-
861  (boost::filesystem::is_regular_file(validatorsFile) ||
-
862  boost::filesystem::is_symlink(validatorsFile)))
-
863  {
-
864  boost::system::error_code ec;
-
865  auto const data = getFileContents(ec, validatorsFile);
-
866  if (ec)
-
867  {
-
868  Throw<std::runtime_error>(
-
869  "Failed to read '" + validatorsFile.string() + "'." +
-
870  std::to_string(ec.value()) + ": " + ec.message());
-
871  }
+
730  try
+
731  {
+
732  if (auto val = sec.get("max_unknown_time"))
+
733  MAX_UNKNOWN_TIME =
+
734  seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
+
735  }
+
736  catch (...)
+
737  {
+
738  Throw<std::runtime_error>(
+
739  "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
740  ": must be of the form '<number>' representing seconds.");
+
741  }
+
742 
+
743  if (MAX_UNKNOWN_TIME < seconds{300} || MAX_UNKNOWN_TIME > seconds{1800})
+
744  Throw<std::runtime_error>(
+
745  "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
746  ": the time must be between 300 and 1800 seconds, inclusive.");
+
747 
+
748  try
+
749  {
+
750  if (auto val = sec.get("max_diverged_time"))
+
751  MAX_DIVERGED_TIME =
+
752  seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
+
753  }
+
754  catch (...)
+
755  {
+
756  Throw<std::runtime_error>(
+
757  "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
758  ": must be of the form '<number>' representing seconds.");
+
759  }
+
760 
+
761  if (MAX_DIVERGED_TIME < seconds{60} || MAX_DIVERGED_TIME > seconds{900})
+
762  {
+
763  Throw<std::runtime_error>(
+
764  "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
765  ": the time must be between 60 and 900 seconds, inclusive.");
+
766  }
+
767  }
+
768 
+
769  if (getSingleSection(
+
770  secConfig, SECTION_AMENDMENT_MAJORITY_TIME, strTemp, j_))
+
771  {
+
772  using namespace std::chrono;
+
773  boost::regex const re(
+
774  "^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
+
775  boost::smatch match;
+
776  if (!boost::regex_match(strTemp, match, re))
+
777  Throw<std::runtime_error>(
+
778  "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
779  ", must be: [0-9]+ [minutes|hours|days|weeks]");
+
780 
+
781  std::uint32_t duration =
+
782  beast::lexicalCastThrow<std::uint32_t>(match[1].str());
+
783 
+
784  if (boost::iequals(match[2], "minutes"))
+
785  AMENDMENT_MAJORITY_TIME = minutes(duration);
+
786  else if (boost::iequals(match[2], "hours"))
+
787  AMENDMENT_MAJORITY_TIME = hours(duration);
+
788  else if (boost::iequals(match[2], "days"))
+
789  AMENDMENT_MAJORITY_TIME = days(duration);
+
790  else if (boost::iequals(match[2], "weeks"))
+
791  AMENDMENT_MAJORITY_TIME = weeks(duration);
+
792 
+
793  if (AMENDMENT_MAJORITY_TIME < minutes(15))
+
794  Throw<std::runtime_error>(
+
795  "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
796  ", the minimum amount of time an amendment must hold a "
+
797  "majority is 15 minutes");
+
798  }
+
799 
+
800  if (getSingleSection(secConfig, SECTION_BETA_RPC_API, strTemp, j_))
+
801  BETA_RPC_API = beast::lexicalCastThrow<bool>(strTemp);
+
802 
+
803  // Do not load trusted validator configuration for standalone mode
+
804  if (!RUN_STANDALONE)
+
805  {
+
806  // If a file was explicitly specified, then throw if the
+
807  // path is malformed or if the file does not exist or is
+
808  // not a file.
+
809  // If the specified file is not an absolute path, then look
+
810  // for it in the same directory as the config file.
+
811  // If no path was specified, then look for validators.txt
+
812  // in the same directory as the config file, but don't complain
+
813  // if we can't find it.
+
814  boost::filesystem::path validatorsFile;
+
815 
+
816  if (getSingleSection(secConfig, SECTION_VALIDATORS_FILE, strTemp, j_))
+
817  {
+
818  validatorsFile = strTemp;
+
819 
+
820  if (validatorsFile.empty())
+
821  Throw<std::runtime_error>(
+
822  "Invalid path specified in [" SECTION_VALIDATORS_FILE "]");
+
823 
+
824  if (!validatorsFile.is_absolute() && !CONFIG_DIR.empty())
+
825  validatorsFile = CONFIG_DIR / validatorsFile;
+
826 
+
827  if (!boost::filesystem::exists(validatorsFile))
+
828  Throw<std::runtime_error>(
+
829  "The file specified in [" SECTION_VALIDATORS_FILE
+
830  "] "
+
831  "does not exist: " +
+
832  validatorsFile.string());
+
833 
+
834  else if (
+
835  !boost::filesystem::is_regular_file(validatorsFile) &&
+
836  !boost::filesystem::is_symlink(validatorsFile))
+
837  Throw<std::runtime_error>(
+
838  "Invalid file specified in [" SECTION_VALIDATORS_FILE
+
839  "]: " +
+
840  validatorsFile.string());
+
841  }
+
842  else if (!CONFIG_DIR.empty())
+
843  {
+
844  validatorsFile = CONFIG_DIR / validatorsFileName;
+
845 
+
846  if (!validatorsFile.empty())
+
847  {
+
848  if (!boost::filesystem::exists(validatorsFile))
+
849  validatorsFile.clear();
+
850  else if (
+
851  !boost::filesystem::is_regular_file(validatorsFile) &&
+
852  !boost::filesystem::is_symlink(validatorsFile))
+
853  validatorsFile.clear();
+
854  }
+
855  }
+
856 
+
857  if (!validatorsFile.empty() &&
+
858  boost::filesystem::exists(validatorsFile) &&
+
859  (boost::filesystem::is_regular_file(validatorsFile) ||
+
860  boost::filesystem::is_symlink(validatorsFile)))
+
861  {
+
862  boost::system::error_code ec;
+
863  auto const data = getFileContents(ec, validatorsFile);
+
864  if (ec)
+
865  {
+
866  Throw<std::runtime_error>(
+
867  "Failed to read '" + validatorsFile.string() + "'." +
+
868  std::to_string(ec.value()) + ": " + ec.message());
+
869  }
+
870 
+
871  auto iniFile = parseIniFile(data, true);
872 
-
873  auto iniFile = parseIniFile(data, true);
+
873  auto entries = getIniFileSection(iniFile, SECTION_VALIDATORS);
874 
-
875  auto entries = getIniFileSection(iniFile, SECTION_VALIDATORS);
-
876 
-
877  if (entries)
-
878  section(SECTION_VALIDATORS).append(*entries);
-
879 
-
880  auto valKeyEntries =
-
881  getIniFileSection(iniFile, SECTION_VALIDATOR_KEYS);
-
882 
-
883  if (valKeyEntries)
-
884  section(SECTION_VALIDATOR_KEYS).append(*valKeyEntries);
-
885 
-
886  auto valSiteEntries =
-
887  getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_SITES);
-
888 
-
889  if (valSiteEntries)
-
890  section(SECTION_VALIDATOR_LIST_SITES).append(*valSiteEntries);
-
891 
-
892  auto valListKeys =
-
893  getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_KEYS);
-
894 
-
895  if (valListKeys)
-
896  section(SECTION_VALIDATOR_LIST_KEYS).append(*valListKeys);
-
897 
-
898  if (!entries && !valKeyEntries && !valListKeys)
-
899  Throw<std::runtime_error>(
-
900  "The file specified in [" SECTION_VALIDATORS_FILE
-
901  "] "
-
902  "does not contain a [" SECTION_VALIDATORS
-
903  "], "
-
904  "[" SECTION_VALIDATOR_KEYS
-
905  "] or "
-
906  "[" SECTION_VALIDATOR_LIST_KEYS
-
907  "]"
-
908  " section: " +
-
909  validatorsFile.string());
-
910  }
-
911 
-
912  // Consolidate [validator_keys] and [validators]
-
913  section(SECTION_VALIDATORS)
-
914  .append(section(SECTION_VALIDATOR_KEYS).lines());
-
915 
-
916  if (!section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
-
917  section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
-
918  {
-
919  Throw<std::runtime_error>(
-
920  "[" + std::string(SECTION_VALIDATOR_LIST_KEYS) +
-
921  "] config section is missing");
-
922  }
-
923  }
-
924 
-
925  {
-
926  auto const part = section("features");
-
927  for (auto const& s : part.values())
-
928  {
-
929  if (auto const f = getRegisteredFeature(s))
-
930  features.insert(*f);
-
931  else
-
932  Throw<std::runtime_error>(
-
933  "Unknown feature: " + s + " in config file.");
-
934  }
-
935  }
-
936 
-
937  // This doesn't properly belong here, but check to make sure that the
-
938  // value specified for network_quorum is achievable:
-
939  {
-
940  auto pm = PEERS_MAX;
-
941 
-
942  // FIXME this apparently magic value is actually defined as a constant
-
943  // elsewhere (see defaultMaxPeers) but we handle this check here.
-
944  if (pm == 0)
-
945  pm = 21;
-
946 
-
947  if (NETWORK_QUORUM > pm)
-
948  {
-
949  Throw<std::runtime_error>(
-
950  "The minimum number of required peers (network_quorum) exceeds "
-
951  "the maximum number of allowed peers (peers_max)");
-
952  }
-
953  }
-
954 }
-
955 
-
956 boost::filesystem::path
-
957 Config::getDebugLogFile() const
-
958 {
-
959  auto log_file = DEBUG_LOGFILE;
-
960 
-
961  if (!log_file.empty() && !log_file.is_absolute())
-
962  {
-
963  // Unless an absolute path for the log file is specified, the
-
964  // path is relative to the config file directory.
-
965  log_file = boost::filesystem::absolute(log_file, CONFIG_DIR);
-
966  }
-
967 
-
968  if (!log_file.empty())
-
969  {
-
970  auto log_dir = log_file.parent_path();
-
971 
-
972  if (!boost::filesystem::is_directory(log_dir))
-
973  {
-
974  boost::system::error_code ec;
-
975  boost::filesystem::create_directories(log_dir, ec);
-
976 
-
977  // If we fail, we warn but continue so that the calling code can
-
978  // decide how to handle this situation.
-
979  if (ec)
-
980  {
-
981  std::cerr << "Unable to create log file path " << log_dir
-
982  << ": " << ec.message() << '\n';
-
983  }
-
984  }
-
985  }
-
986 
-
987  return log_file;
-
988 }
-
989 
-
990 int
-
991 Config::getValueFor(SizedItem item, std::optional<std::size_t> node) const
-
992 {
-
993  auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
-
994  assert(index < sizedItems.size());
-
995  assert(!node || *node <= 4);
-
996  return sizedItems.at(index).second.at(node.value_or(NODE_SIZE));
-
997 }
-
998 
-
999 } // namespace ripple
+
875  if (entries)
+
876  section(SECTION_VALIDATORS).append(*entries);
+
877 
+
878  auto valKeyEntries =
+
879  getIniFileSection(iniFile, SECTION_VALIDATOR_KEYS);
+
880 
+
881  if (valKeyEntries)
+
882  section(SECTION_VALIDATOR_KEYS).append(*valKeyEntries);
+
883 
+
884  auto valSiteEntries =
+
885  getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_SITES);
+
886 
+
887  if (valSiteEntries)
+
888  section(SECTION_VALIDATOR_LIST_SITES).append(*valSiteEntries);
+
889 
+
890  auto valListKeys =
+
891  getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_KEYS);
+
892 
+
893  if (valListKeys)
+
894  section(SECTION_VALIDATOR_LIST_KEYS).append(*valListKeys);
+
895 
+
896  if (!entries && !valKeyEntries && !valListKeys)
+
897  Throw<std::runtime_error>(
+
898  "The file specified in [" SECTION_VALIDATORS_FILE
+
899  "] "
+
900  "does not contain a [" SECTION_VALIDATORS
+
901  "], "
+
902  "[" SECTION_VALIDATOR_KEYS
+
903  "] or "
+
904  "[" SECTION_VALIDATOR_LIST_KEYS
+
905  "]"
+
906  " section: " +
+
907  validatorsFile.string());
+
908  }
+
909 
+
910  // Consolidate [validator_keys] and [validators]
+
911  section(SECTION_VALIDATORS)
+
912  .append(section(SECTION_VALIDATOR_KEYS).lines());
+
913 
+
914  if (!section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
+
915  section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
+
916  {
+
917  Throw<std::runtime_error>(
+
918  "[" + std::string(SECTION_VALIDATOR_LIST_KEYS) +
+
919  "] config section is missing");
+
920  }
+
921  }
+
922 
+
923  {
+
924  auto const part = section("features");
+
925  for (auto const& s : part.values())
+
926  {
+
927  if (auto const f = getRegisteredFeature(s))
+
928  features.insert(*f);
+
929  else
+
930  Throw<std::runtime_error>(
+
931  "Unknown feature: " + s + " in config file.");
+
932  }
+
933  }
+
934 
+
935  // This doesn't properly belong here, but check to make sure that the
+
936  // value specified for network_quorum is achievable:
+
937  {
+
938  auto pm = PEERS_MAX;
+
939 
+
940  // FIXME this apparently magic value is actually defined as a constant
+
941  // elsewhere (see defaultMaxPeers) but we handle this check here.
+
942  if (pm == 0)
+
943  pm = 21;
+
944 
+
945  if (NETWORK_QUORUM > pm)
+
946  {
+
947  Throw<std::runtime_error>(
+
948  "The minimum number of required peers (network_quorum) exceeds "
+
949  "the maximum number of allowed peers (peers_max)");
+
950  }
+
951  }
+
952 }
+
953 
+
954 boost::filesystem::path
+
955 Config::getDebugLogFile() const
+
956 {
+
957  auto log_file = DEBUG_LOGFILE;
+
958 
+
959  if (!log_file.empty() && !log_file.is_absolute())
+
960  {
+
961  // Unless an absolute path for the log file is specified, the
+
962  // path is relative to the config file directory.
+
963  log_file = boost::filesystem::absolute(log_file, CONFIG_DIR);
+
964  }
+
965 
+
966  if (!log_file.empty())
+
967  {
+
968  auto log_dir = log_file.parent_path();
+
969 
+
970  if (!boost::filesystem::is_directory(log_dir))
+
971  {
+
972  boost::system::error_code ec;
+
973  boost::filesystem::create_directories(log_dir, ec);
+
974 
+
975  // If we fail, we warn but continue so that the calling code can
+
976  // decide how to handle this situation.
+
977  if (ec)
+
978  {
+
979  std::cerr << "Unable to create log file path " << log_dir
+
980  << ": " << ec.message() << '\n';
+
981  }
+
982  }
+
983  }
+
984 
+
985  return log_file;
+
986 }
+
987 
+
988 int
+
989 Config::getValueFor(SizedItem item, std::optional<std::size_t> node) const
+
990 {
+
991  auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
+
992  assert(index < sizedItems.size());
+
993  assert(!node || *node <= 4);
+
994  return sizedItems.at(index).second.at(node.value_or(NODE_SIZE));
+
995 }
+
996 
+
997 } // namespace ripple
ripple::SizedItem::openFinalLimit
@ openFinalLimit
ripple::Section
Holds a collection of configuration values.
Definition: BasicConfig.h:42
@@ -1091,7 +1089,7 @@ $(function() {
ripple::Config::PEER_PRIVATE
bool PEER_PRIVATE
Definition: Config.h:156
ripple::Config::DEBUG_LOGFILE
boost::filesystem::path DEBUG_LOGFILE
Definition: Config.h:88
std::map::emplace
T emplace(T... args)
-
ripple::Config::setupControl
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:274
+
ripple::Config::setupControl
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:272
ripple::SizedItem::treeCacheAge
@ treeCacheAge
beast::Journal::warn
Stream warn() const
Definition: Journal.h:327
std::distance
T distance(T... args)
@@ -1111,12 +1109,12 @@ $(function() {
std::underlying_type_t
ripple::Config::RUN_STANDALONE
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition: Config.h:105
ripple::SizedItem::ramSizeGB
@ ramSizeGB
-
ripple::Config::load
void load()
Definition: Config.cpp:436
+
ripple::Config::load
void load()
Definition: Config.cpp:434
ripple::Config::j_
const beast::Journal j_
Definition: Config.h:92
ripple::Config::RELAY_UNTRUSTED_PROPOSALS
int RELAY_UNTRUSTED_PROPOSALS
Definition: Config.h:153
ripple::Config::SSL_VERIFY_FILE
std::string SSL_VERIFY_FILE
Definition: Config.h:201
-
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:458
-
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:991
+
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:456
+
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:989
ripple::weeks
std::chrono::duration< int, std::ratio_multiply< days::period, std::ratio< 7 > >> weeks
Definition: chrono.h:41
thread
ripple::Config::FAST_LOAD
bool FAST_LOAD
Definition: Config.h:276
@@ -1160,7 +1158,7 @@ $(function() {
ripple::Config::features
std::unordered_set< uint256, beast::uhash<> > features
Definition: Config.h:262
ripple::Config::PATH_SEARCH_FAST
int PATH_SEARCH_FAST
Definition: Config.h:180
ripple::getSingleSection
bool getSingleSection(IniFileSections &secSource, std::string const &strSection, std::string &strValue, beast::Journal j)
Definition: Config.cpp:221
-
ripple::Config::setup
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:316
+
ripple::Config::setup
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:314
cstdlib
std::endl
T endl(T... args)
std::clamp
T clamp(T... args)
@@ -1187,7 +1185,7 @@ $(function() {
ripple::Config::TX_REDUCE_RELAY_ENABLE
bool TX_REDUCE_RELAY_ENABLE
Definition: Config.h:244
ripple::getRegisteredFeature
std::optional< uint256 > getRegisteredFeature(std::string const &name)
Definition: Feature.cpp:341
ripple::Config::SILENT
bool SILENT
Definition: Config.h:95
-
ripple::Config::getDebugLogFile
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition: Config.cpp:957
+
ripple::Config::getDebugLogFile
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition: Config.cpp:955
ripple::Config::signingEnabled_
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition: Config.h:119
std::numeric_limits
ripple::Config::ELB_SUPPORT
bool ELB_SUPPORT
Definition: Config.h:127
diff --git a/Config_8h_source.html b/Config_8h_source.html index 18ede6414d..2928e6c5e5 100644 --- a/Config_8h_source.html +++ b/Config_8h_source.html @@ -411,7 +411,7 @@ $(function() {
ripple::Config::VALIDATION_QUORUM
std::optional< std::size_t > VALIDATION_QUORUM
Definition: Config.h:185
unordered_set
ripple::Config::LEDGER_REPLAY
bool LEDGER_REPLAY
Definition: Config.h:208
-
ripple::Config::Config
Config()
Definition: Config.cpp:268
+
ripple::Config::Config
Config()
Definition: Config.cpp:266
ripple::SizedItem::accountIdCacheSize
@ accountIdCacheSize
ripple::Config::validatorsFileName
static char const *const validatorsFileName
Definition: Config.h:75
vector
@@ -422,7 +422,7 @@ $(function() {
ripple::Config::PEER_PRIVATE
bool PEER_PRIVATE
Definition: Config.h:156
ripple::Config::DEBUG_LOGFILE
boost::filesystem::path DEBUG_LOGFILE
Definition: Config.h:88
ripple::Config::silent
bool silent() const
Definition: Config.h:307
-
ripple::Config::setupControl
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:274
+
ripple::Config::setupControl
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:272
ripple::SizedItem::treeCacheAge
@ treeCacheAge
ripple::Config::LOAD
@ LOAD
Definition: Config.h:133
ripple::Config::ramSize_
const std::uint64_t ramSize_
Definition: Config.h:122
@@ -439,13 +439,13 @@ $(function() {
ripple::Config::IO_WORKERS
int IO_WORKERS
Definition: Config.h:220
ripple::Config::RUN_STANDALONE
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition: Config.h:105
ripple::SizedItem::ramSizeGB
@ ramSizeGB
-
ripple::Config::load
void load()
Definition: Config.cpp:436
+
ripple::Config::load
void load()
Definition: Config.cpp:434
ripple::Config::j_
const beast::Journal j_
Definition: Config.h:92
ripple::Config::RELAY_UNTRUSTED_PROPOSALS
int RELAY_UNTRUSTED_PROPOSALS
Definition: Config.h:153
ripple::Config::reporting
bool reporting() const
Definition: Config.h:317
ripple::Config::SSL_VERIFY_FILE
std::string SSL_VERIFY_FILE
Definition: Config.h:201
-
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:458
-
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:991
+
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:456
+
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:989
ripple::Config::FORCE_MULTI_THREAD
bool FORCE_MULTI_THREAD
Definition: Config.h:224
ripple::Config::FAST_LOAD
bool FAST_LOAD
Definition: Config.h:276
ripple::Config
Definition: Config.h:69
@@ -493,7 +493,7 @@ $(function() {
ripple::Config::FRESH
@ FRESH
Definition: Config.h:133
ripple::Config::features
std::unordered_set< uint256, beast::uhash<> > features
Definition: Config.h:262
ripple::Config::PATH_SEARCH_FAST
int PATH_SEARCH_FAST
Definition: Config.h:180
-
ripple::Config::setup
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:316
+
ripple::Config::setup
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:314
ripple::SizedItem::treeCacheSize
@ treeCacheSize
ripple::Config::TX_REDUCE_RELAY_MIN_PEERS
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition: Config.h:254
ripple::Config::SERVER_DOMAIN
std::string SERVER_DOMAIN
Definition: Config.h:264
@@ -514,7 +514,7 @@ $(function() {
ripple::Config::TX_REDUCE_RELAY_ENABLE
bool TX_REDUCE_RELAY_ENABLE
Definition: Config.h:244
ripple::Config::reportingReadOnly
bool reportingReadOnly() const
Definition: Config.h:329
ripple::Config::SILENT
bool SILENT
Definition: Config.h:95
-
ripple::Config::getDebugLogFile
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition: Config.cpp:957
+
ripple::Config::getDebugLogFile
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition: Config.cpp:955
ripple::Config::signingEnabled_
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition: Config.h:119
ripple::Config::LOAD_FILE
@ LOAD_FILE
Definition: Config.h:133
ripple::Config::ELB_SUPPORT
bool ELB_SUPPORT
Definition: Config.h:127
diff --git a/Config__test_8cpp_source.html b/Config__test_8cpp_source.html index 784c28a7b2..32e65cb224 100644 --- a/Config__test_8cpp_source.html +++ b/Config__test_8cpp_source.html @@ -1256,7 +1256,7 @@ $(function() {
ripple::Config_test::testLegacy
void testLegacy()
Definition: Config_test.cpp:276
ripple::test::detail::FileDirGuard::file
path const & file() const
Definition: FileDirGuard.h:164
ripple::detail::ValidatorsTxtGuard::validatorsFileExists
bool validatorsFileExists() const
Definition: Config_test.cpp:252
-
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:458
+
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:456
ripple::detail::RippledCfgGuard::configFile
std::string configFile() const
Definition: Config_test.cpp:169
ripple::Config
Definition: Config.h:69
std::ofstream
STL class.
@@ -1282,7 +1282,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::test::detail::FileDirGuard::FileDirGuard
FileDirGuard(beast::unit_test::suite &test, path subDir, path file, std::string const &contents, bool useCounter=true, bool create=true)
Definition: FileDirGuard.h:114
ripple::detail::RippledCfgGuard::rmDataDir_
bool rmDataDir_
Definition: Config_test.cpp:132
-
ripple::Config::setup
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:316
+
ripple::Config::setup
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition: Config.cpp:314
std::endl
T endl(T... args)
ripple::Config_test::testValidatorsFile
void testValidatorsFile()
Definition: Config_test.cpp:415
std
STL namespace.
diff --git a/Env__test_8cpp_source.html b/Env__test_8cpp_source.html index aabdc140f6..f5641416e3 100644 --- a/Env__test_8cpp_source.html +++ b/Env__test_8cpp_source.html @@ -1129,7 +1129,7 @@ $(function() {
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::test::Env_test::testAmount
void testAmount()
Definition: Env_test.cpp:72
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:82
-
ripple::TxQ::getMetrics
Metrics getMetrics(OpenView const &view) const
Returns fee metrics in reference fee level units.
Definition: TxQ.cpp:1732
+
ripple::TxQ::getMetrics
Metrics getMetrics(OpenView const &view) const
Returns fee metrics in reference fee level units.
Definition: TxQ.cpp:1730
ripple::test::jtx::Env::memoize
void memoize(Account const &account)
Associate AccountID with account.
Definition: Env.cpp:156
std::unique_ptr
STL class.
std::set
STL class.
diff --git a/Fee1_8cpp_source.html b/Fee1_8cpp_source.html index 0da14ba11a..d8fee58fb7 100644 --- a/Fee1_8cpp_source.html +++ b/Fee1_8cpp_source.html @@ -115,7 +115,7 @@ $(function() {
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
ripple::Application::getTxQ
virtual TxQ & getTxQ()=0
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
-
ripple::TxQ::doRPC
Json::Value doRPC(Application &app) const
Summarize current fee metrics for the fee RPC command.
Definition: TxQ.cpp:1811
+
ripple::TxQ::doRPC
Json::Value doRPC(Application &app) const
Summarize current fee metrics for the fee RPC command.
Definition: TxQ.cpp:1809
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
diff --git a/LedgerHandler_8cpp_source.html b/LedgerHandler_8cpp_source.html index e82f6c5e4e..c9284519cf 100644 --- a/LedgerHandler_8cpp_source.html +++ b/LedgerHandler_8cpp_source.html @@ -115,7 +115,7 @@ $(function() {
44  params.isMember(jss::ledger_hash) ||
45  params.isMember(jss::ledger_index) || context_.app.config().reporting();
46  if (!needsLedger)
-
47  return Status::OK;
+
47  return Status::OK;
48 
49  if (auto s = lookupLedger(ledger_, context_, result_))
50  return s;
@@ -167,7 +167,7 @@ $(function() {
96  queueTxs_ = context_.app.getTxQ().getTxs();
97  }
98 
-
99  return Status::OK;
+
99  return Status::OK;
100 }
101 
102 } // namespace RPC
@@ -384,7 +384,6 @@ $(function() {
ripple::ReadView::info
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
ripple::LedgerFill::dumpTxrp
@ dumpTxrp
Definition: LedgerToJson.h:46
-
ripple::RPC::Status::OK
static constexpr Code OK
Definition: Status.h:46
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::RPC::LedgerHandler::context_
JsonContext & context_
Definition: LedgerHandler.h:80
std::shared_ptr
STL class.
@@ -394,7 +393,7 @@ $(function() {
ripple::sfOwner
const SF_ACCOUNT sfOwner
ripple::addRaw
void addRaw(LedgerInfo const &info, Serializer &s, bool includeHash)
Definition: View.cpp:162
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
-
ripple::TxQ::getTxs
std::vector< TxDetails > getTxs() const
Returns information about all transactions currently in the queue.
Definition: TxQ.cpp:1796
+
ripple::TxQ::getTxs
std::vector< TxDetails > getTxs() const
Returns information about all transactions currently in the queue.
Definition: TxQ.cpp:1794
ripple::RPC::LedgerHandler::ledger_
std::shared_ptr< ReadView const > ledger_
Definition: LedgerHandler.h:81
ripple::LedgerFill::dumpQueue
@ dumpQueue
Definition: LedgerToJson.h:52
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition: Context.h:45
@@ -410,6 +409,7 @@ $(function() {
ripple::Serializer::data
void const * data() const noexcept
Definition: Serializer.h:75
ripple::RPC::Context::j
const beast::Journal j
Definition: Context.h:41
ripple::LoadFeeTrack::isLoadedLocal
bool isLoadedLocal() const
Definition: LoadFeeTrack.h:126
+
ripple::RPC::Status::OK
static constexpr Code OK
Definition: Status.h:46
ripple::Config::reporting
bool reporting() const
Definition: Config.h:317
ripple::Application::getLedgerMaster
virtual LedgerMaster & getLedgerMaster()=0
ripple::Application::config
virtual Config & config()=0
diff --git a/LedgerHistory_8cpp_source.html b/LedgerHistory_8cpp_source.html index 7f1a2fef23..830415cf03 100644 --- a/LedgerHistory_8cpp_source.html +++ b/LedgerHistory_8cpp_source.html @@ -623,7 +623,7 @@ $(function() {
ripple::LedgerHistory::m_consensus_validated
ConsensusValidated m_consensus_validated
Definition: LedgerHistory.h:149
ripple::base_uint< 256 >
ripple::loadByHash
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition: Ledger.cpp:1078
-
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:991
+
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:989
ripple::LedgerHistory::insert
bool insert(std::shared_ptr< Ledger const > ledger, bool validated)
Track a ledger.
Definition: LedgerHistory.cpp:54
ripple::base_uint::isZero
bool isZero() const
Definition: base_uint.h:531
ripple::LedgerHistory::app_
Application & app_
Definition: LedgerHistory.h:125
diff --git a/LedgerReplay__test_8cpp_source.html b/LedgerReplay__test_8cpp_source.html index 04dde9ad9b..7b45dd4e6c 100644 --- a/LedgerReplay__test_8cpp_source.html +++ b/LedgerReplay__test_8cpp_source.html @@ -1713,7 +1713,7 @@ $(function() {
ripple::test::TestPeer::getClosedLedgerHash
uint256 const & getClosedLedgerHash() const override
Definition: LedgerReplay_test.cpp:259
ripple::test::MagicInboundLedgers::clearFailures
virtual void clearFailures() override
Definition: LedgerReplay_test.cpp:141
ripple::test::TestPeerSet::getPeerIds
const std::set< Peer::id_t > & getPeerIds() const override
get the set of ids of previously added peers
Definition: LedgerReplay_test.cpp:399
-
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:458
+
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:456
ripple::test::PeerSetBehavior::DropAll
@ DropAll
thread
beast::IP::Address
boost::asio::ip::address Address
Definition: IPAddress.h:41
diff --git a/Main_8cpp_source.html b/Main_8cpp_source.html index 186952335d..cec20b06df 100644 --- a/Main_8cpp_source.html +++ b/Main_8cpp_source.html @@ -888,7 +888,7 @@ $(function() {
std::for_each
T for_each(T... args)
std::domain_error
STL class.
std::string
STL class.
-
ripple::test::multi_runner_parent::add_failures
void add_failures(std::size_t failures)
Definition: multi_runner.cpp:502
+
ripple::test::multi_runner_parent::add_failures
void add_failures(std::size_t failures)
Definition: multi_runner.cpp:497
utility
std::exception
STL class.
ripple::printHelp
void printHelp(const po::options_description &desc)
Definition: Main.cpp:122
@@ -912,7 +912,7 @@ $(function() {
ripple::setDebugLogSink
std::unique_ptr< beast::Journal::Sink > setDebugLogSink(std::unique_ptr< beast::Journal::Sink > sink)
Set the sink for the debug journal.
Definition: Log.cpp:446
ripple::BuildInfo::getVersionString
std::string const & getVersionString()
Server version.
Definition: BuildInfo.cpp:65
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
-
ripple::test::multi_runner_parent::any_failed
bool any_failed() const
Definition: multi_runner.cpp:484
+
ripple::test::multi_runner_parent::any_failed
bool any_failed() const
Definition: multi_runner.cpp:479
std::atomic< bool >
beast::severities::kInfo
@ kInfo
Definition: Journal.h:36
ripple::RPCCall::fromCommandLine
int fromCommandLine(Config const &config, const std::vector< std::string > &vCmd, Logs &logs)
Definition: RPCCall.cpp:1681
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html index 5f20c57b30..2de51d9cd6 100644 --- a/NetworkOPs_8cpp_source.html +++ b/NetworkOPs_8cpp_source.html @@ -5097,7 +5097,7 @@ $(function() {
std::numeric_limits::max
T max(T... args)
ripple::NetworkOPsImp::accountHistoryTxTimer_
boost::asio::steady_timer accountHistoryTxTimer_
Definition: NetworkOPs.cpp:728
ripple::make_LocalTxs
std::unique_ptr< LocalTxs > make_LocalTxs()
Definition: LocalTxs.cpp:197
-
ripple::TxQ::getMetrics
Metrics getMetrics(OpenView const &view) const
Returns fee metrics in reference fee level units.
Definition: TxQ.cpp:1732
+
ripple::TxQ::getMetrics
Metrics getMetrics(OpenView const &view) const
Returns fee metrics in reference fee level units.
Definition: TxQ.cpp:1730
ripple::NetworkOPsImp::doTransactionSync
void doTransactionSync(std::shared_ptr< Transaction > transaction, bool bUnlimited, FailHard failType)
For transactions submitted directly by a client, apply batch of transactions and wait for this transa...
Definition: NetworkOPs.cpp:1257
ripple::NetworkOPsImp::StateAccounting::getCounterData
CounterData getCounterData() const
Definition: NetworkOPs.cpp:183
ripple::NetworkOPsImp::Stats::full_duration
beast::insight::Gauge full_duration
Definition: NetworkOPs.cpp:820
diff --git a/Node_8cpp_source.html b/Node_8cpp_source.html index 8794c55dfa..52947bf54a 100644 --- a/Node_8cpp_source.html +++ b/Node_8cpp_source.html @@ -1473,7 +1473,7 @@ $(function() {
ripple::isPseudoTx
bool isPseudoTx(STObject const &tx)
Check whether a transaction is a pseudo-transaction.
Definition: STTx.cpp:559
ripple::detail::getTxHistory
std::pair< std::vector< std::shared_ptr< Transaction > >, int > getTxHistory(soci::session &session, Application &app, LedgerIndex startIndex, int quantity, bool count)
getTxHistory Returns given number of most recent transactions starting from given number of entry.
Definition: Node.cpp:616
ripple::DatabaseCon::Setup::standAlone
bool standAlone
Definition: DatabaseCon.h:89
-
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:991
+
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:989
ripple::DatabaseCon::checkoutDb
LockedSociSession checkoutDb()
Definition: DatabaseCon.h:178
ripple::LedgerHashPair::ledgerHash
uint256 ledgerHash
Definition: RelationalDatabase.h:38
ripple::LgrDBPragma
constexpr std::array< char const *, 1 > LgrDBPragma
Definition: DBInit.h:45
diff --git a/OpenLedger_8cpp_source.html b/OpenLedger_8cpp_source.html index fe88d6f119..85212c3c3c 100644 --- a/OpenLedger_8cpp_source.html +++ b/OpenLedger_8cpp_source.html @@ -307,7 +307,7 @@ $(function() {
ripple::apply
std::pair< TER, bool > apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition: apply.cpp:109
ripple::open_ledger
const open_ledger_t open_ledger
Definition: OpenView.cpp:25
std::pair
-
ripple::TxQ::apply
std::pair< TER, bool > apply(Application &app, OpenView &view, std::shared_ptr< STTx const > const &tx, ApplyFlags flags, beast::Journal j)
Add a new transaction to the open ledger, hold it in the queue, or reject it.
Definition: TxQ.cpp:710
+
ripple::TxQ::apply
std::pair< TER, bool > apply(Application &app, OpenView &view, std::shared_ptr< STTx const > const &tx, ApplyFlags flags, beast::Journal j)
Add a new transaction to the open ledger, hold it in the queue, or reject it.
Definition: TxQ.cpp:708
ripple::OpenView
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:55
std::vector
STL class.
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:29
diff --git a/PeerFinder__test_8cpp_source.html b/PeerFinder__test_8cpp_source.html index cb45553878..2d47ee723b 100644 --- a/PeerFinder__test_8cpp_source.html +++ b/PeerFinder__test_8cpp_source.html @@ -379,7 +379,7 @@ $(function() {
ripple::PeerFinder::Result::success
@ success
ripple::PeerFinder::Counts::out_max
int out_max() const
Returns the total number of outbound slots.
Definition: Counts.h:103
ripple::PeerFinder::Counts
Manages the count of available connections for the various slots.
Definition: Counts.h:34
-
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:458
+
ripple::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition: Config.cpp:456
ripple::PeerFinder::Logic::onConnected
bool onConnected(SlotImp::ptr const &slot, beast::IP::Endpoint const &local_endpoint)
Definition: peerfinder/impl/Logic.h:346
ripple::PeerFinder::PeerFinder_test::test_invalid_config
void test_invalid_config()
Definition: PeerFinder_test.cpp:233
ripple::PeerFinder::PeerFinder_test::TestChecker::stop
void stop()
Definition: PeerFinder_test.cpp:58
diff --git a/RPCHelpers_8cpp_source.html b/RPCHelpers_8cpp_source.html index 6343316a86..430a451d74 100644 --- a/RPCHelpers_8cpp_source.html +++ b/RPCHelpers_8cpp_source.html @@ -444,7 +444,7 @@ $(function() {
373  }
374  }
375 
-
376  return Status::OK;
+
376  return Status::OK;
377 }
378 
379 template <class T>
@@ -454,7 +454,7 @@ $(function() {
383  ledger = context.ledgerMaster.getLedgerByHash(ledgerHash);
384  if (ledger == nullptr)
385  return {rpcLGR_NOT_FOUND, "ledgerNotFound"};
-
386  return Status::OK;
+
386  return Status::OK;
387 }
388 
389 template <class T>
@@ -485,7 +485,7 @@ $(function() {
414  return {rpcNOT_SYNCED, "notSynced"};
415  }
416 
-
417  return Status::OK;
+
417  return Status::OK;
418 }
419 
420 template <class T>
@@ -556,7 +556,7 @@ $(function() {
485  return {rpcNOT_SYNCED, "notSynced"};
486  }
487  }
-
488  return Status::OK;
+
488  return Status::OK;
489 }
490 
491 // Explicit instantiaion of above three functions
@@ -667,7 +667,7 @@ $(function() {
596 
597  result[jss::validated] =
598  isValidated(context.ledgerMaster, *ledger, context.app);
-
599  return Status::OK;
+
599  return Status::OK;
600 }
601 
602 Json::Value
@@ -951,7 +951,7 @@ $(function() {
880 std::pair<RPC::Status, LedgerEntryType>
881 chooseLedgerEntryType(Json::Value const& params)
882 {
-
883  std::pair<RPC::Status, LedgerEntryType> result{RPC::Status::OK, ltANY};
+
883  std::pair<RPC::Status, LedgerEntryType> result{RPC::Status::OK, ltANY};
884  if (params.isMember(jss::type))
885  {
886  static constexpr std::array<std::pair<char const*, LedgerEntryType>, 14>
@@ -1143,7 +1143,6 @@ $(function() {
ripple::ReadView::info
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
ripple::RPC::apiInvalidVersion
constexpr unsigned int apiInvalidVersion
API version numbers used in later API versions.
Definition: RPCHelpers.h:241
ripple::sfIndexNext
const SF_UINT64 sfIndexNext
-
ripple::RPC::Status::OK
static constexpr Code OK
Definition: Status.h:46
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:303
ripple::Application
Definition: Application.h:115
ripple::RPC::apiVersionIfUnspecified
constexpr unsigned int apiVersionIfUnspecified
Definition: RPCHelpers.h:242
@@ -1223,6 +1222,7 @@ $(function() {
ripple::ltAMENDMENTS
@ ltAMENDMENTS
The ledger object which lists details about amendments on the network.
Definition: LedgerFormats.h:110
ripple::sfLowLimit
const SF_AMOUNT sfLowLimit
ripple::RPC::parseRippleLibSeed
std::optional< Seed > parseRippleLibSeed(Json::Value const &value)
Definition: RPCHelpers.cpp:673
+
ripple::RPC::Status::OK
static constexpr Code OK
Definition: Status.h:46
ripple::rpcSUCCESS
@ rpcSUCCESS
Definition: ErrorCodes.h:44
ripple::ltOFFER
@ ltOFFER
A ledger object which describes an offer on the DEX.
Definition: LedgerFormats.h:92
ripple::Config::reporting
bool reporting() const
Definition: Config.h:317
diff --git a/SHAMapStoreImp_8cpp_source.html b/SHAMapStoreImp_8cpp_source.html index d3dff424ac..dc5a683fc3 100644 --- a/SHAMapStoreImp_8cpp_source.html +++ b/SHAMapStoreImp_8cpp_source.html @@ -869,7 +869,7 @@ $(function() {
ripple::Config::reporting
bool reporting() const
Definition: Config.h:317
ripple::SHAMapStoreImp::recoveryWaitTime_
std::chrono::seconds recoveryWaitTime_
If the node is out of sync during an online_delete healthWait() call, sleep the thread for this time,...
Definition: SHAMapStoreImp.h:111
ripple::SHAMapStoreImp::stop_
bool stop_
Definition: SHAMapStoreImp.h:92
-
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:991
+
ripple::Config::getValueFor
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition: Config.cpp:989
ripple::Application::getLedgerMaster
virtual LedgerMaster & getLedgerMaster()=0
ripple::Config
Definition: Config.h:69
ripple::SHAMapStoreImp::advisoryDelete_
bool advisoryDelete_
Definition: SHAMapStoreImp.h:103
diff --git a/Status_8cpp_source.html b/Status_8cpp_source.html index c36c82712b..f07998f942 100644 --- a/Status_8cpp_source.html +++ b/Status_8cpp_source.html @@ -94,108 +94,104 @@ $(function() {
23 namespace ripple {
24 namespace RPC {
25 
-
26 constexpr Status::Code Status::OK;
-
27 
-
28 std::string
-
29 Status::codeString() const
-
30 {
-
31  if (!*this)
-
32  return "";
-
33 
-
34  if (type_ == Type::none)
-
35  return std::to_string(code_);
-
36 
-
37  if (type_ == Status::Type::TER)
-
38  {
-
39  std::string s1, s2;
-
40 
-
41  auto success = transResultInfo(toTER(), s1, s2);
-
42  assert(success);
-
43  (void)success;
-
44 
-
45  return s1 + ": " + s2;
-
46  }
-
47 
-
48  if (type_ == Status::Type::error_code_i)
-
49  {
-
50  auto info = get_error_info(toErrorCode());
-
51  std::ostringstream sStr;
-
52  sStr << info.token.c_str() << ": " << info.message.c_str();
-
53  return sStr.str();
-
54  }
-
55 
-
56  assert(false);
-
57  return "";
-
58 }
-
59 
-
60 void
-
61 Status::fillJson(Json::Value& value)
-
62 {
-
63  if (!*this)
-
64  return;
-
65 
-
66  auto& error = value[jss::error];
-
67  error[jss::code] = code_;
-
68  error[jss::message] = codeString();
-
69 
-
70  // Are there any more messages?
-
71  if (!messages_.empty())
-
72  {
-
73  auto& messages = error[jss::data];
-
74  for (auto& i : messages_)
-
75  messages.append(i);
-
76  }
-
77 }
-
78 
-
79 std::string
-
80 Status::message() const
-
81 {
-
82  std::string result;
-
83  for (auto& m : messages_)
-
84  {
-
85  if (!result.empty())
-
86  result += '/';
-
87  result += m;
-
88  }
-
89 
-
90  return result;
-
91 }
-
92 
-
93 std::string
-
94 Status::toString() const
-
95 {
-
96  if (*this)
-
97  return codeString() + ":" + message();
-
98  return "";
-
99 }
-
100 
-
101 } // namespace RPC
-
102 } // namespace ripple
+
26 std::string
+
27 Status::codeString() const
+
28 {
+
29  if (!*this)
+
30  return "";
+
31 
+
32  if (type_ == Type::none)
+
33  return std::to_string(code_);
+
34 
+
35  if (type_ == Status::Type::TER)
+
36  {
+
37  std::string s1, s2;
+
38 
+
39  auto success = transResultInfo(toTER(), s1, s2);
+
40  assert(success);
+
41  (void)success;
+
42 
+
43  return s1 + ": " + s2;
+
44  }
+
45 
+
46  if (type_ == Status::Type::error_code_i)
+
47  {
+
48  auto info = get_error_info(toErrorCode());
+
49  std::ostringstream sStr;
+
50  sStr << info.token.c_str() << ": " << info.message.c_str();
+
51  return sStr.str();
+
52  }
+
53 
+
54  assert(false);
+
55  return "";
+
56 }
+
57 
+
58 void
+
59 Status::fillJson(Json::Value& value)
+
60 {
+
61  if (!*this)
+
62  return;
+
63 
+
64  auto& error = value[jss::error];
+
65  error[jss::code] = code_;
+
66  error[jss::message] = codeString();
+
67 
+
68  // Are there any more messages?
+
69  if (!messages_.empty())
+
70  {
+
71  auto& messages = error[jss::data];
+
72  for (auto& i : messages_)
+
73  messages.append(i);
+
74  }
+
75 }
+
76 
+
77 std::string
+
78 Status::message() const
+
79 {
+
80  std::string result;
+
81  for (auto& m : messages_)
+
82  {
+
83  if (!result.empty())
+
84  result += '/';
+
85  result += m;
+
86  }
+
87 
+
88  return result;
+
89 }
+
90 
+
91 std::string
+
92 Status::toString() const
+
93 {
+
94  if (*this)
+
95  return codeString() + ":" + message();
+
96  return "";
+
97 }
+
98 
+
99 } // namespace RPC
+
100 } // namespace ripple
-
ripple::RPC::Status::OK
static constexpr Code OK
Definition: Status.h:46
ripple::RPC::Status::messages_
Strings messages_
Definition: Status.h:154
sstream
std::string
STL class.
ripple::RPC::get_error_info
ErrorInfo const & get_error_info(error_code_i code)
Returns an ErrorInfo that reflects the error code.
Definition: ErrorCodes.cpp:180
-
ripple::RPC::Status::codeString
std::string codeString() const
Definition: Status.cpp:29
+
ripple::RPC::Status::codeString
std::string codeString() const
Definition: Status.cpp:27
ripple::RPC::Status::messages
Strings const & messages() const
Definition: Status.h:127
ripple::RPC::Status::toErrorCode
error_code_i toErrorCode() const
Returns the Status as an error_code_i.
Definition: Status.h:105
ripple::RPC::Status::Type::TER
@ TER
std::to_string
T to_string(T... args)
ripple::RPC::Status::Type::error_code_i
@ error_code_i
ripple::RPC::Status::code_
Code code_
Definition: Status.h:153
-
ripple::RPC::Status::Code
int Code
Definition: Status.h:43
std::ostringstream
STL class.
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::transResultInfo
bool transResultInfo(TER code, std::string &token, std::string &text)
Definition: TER.cpp:192
ripple::RPC::Status::toTER
TER toTER() const
Returns the Status as a TER.
Definition: Status.h:96
ripple::RPC::Status::type_
Type type_
Definition: Status.h:152
-
ripple::RPC::Status::message
std::string message() const
Return the first message, if any.
Definition: Status.cpp:80
+
ripple::RPC::Status::message
std::string message() const
Return the first message, if any.
Definition: Status.cpp:78
std::vector::empty
T empty(T... args)
ripple::RPC::Status::Type::none
@ none
std::ostringstream::str
T str(T... args)
-
ripple::RPC::Status::fillJson
void fillJson(Json::Value &)
Fill a Json::Value with an RPC 2.0 response.
Definition: Status.cpp:61
-
ripple::RPC::Status::toString
std::string toString() const
Definition: Status.cpp:94
+
ripple::RPC::Status::fillJson
void fillJson(Json::Value &)
Fill a Json::Value with an RPC 2.0 response.
Definition: Status.cpp:59
+
ripple::RPC::Status::toString
std::string toString() const
Definition: Status.cpp:92
Json::Value
Represents a JSON value.
Definition: json_value.h:145