+
+
+
-
-
-
-
-
-
-
-
-
-
-
454 for (
auto& line : strVec)
-
-
-
457 if (
std::count(line.begin(), line.end(),
':') != 1)
-
-
-
-
-
-
463 if (result.
size() == line.size())
-
-
-
-
-
-
-
-
-
-
-
-
-
476 boost::filesystem::path p(dbPath);
-
477 legacy(
"database_path", boost::filesystem::absolute(p).
string());
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
456 for (
auto& line : strVec)
+
+
+
459 if (
std::count(line.begin(), line.end(),
':') != 1)
+
+
+
+
+
+
465 if (result.
size() == line.size())
+
+
+
+
+
+
+
+
+
+
+
+
+
478 boost::filesystem::path p(dbPath);
+
479 legacy(
"database_path", boost::filesystem::absolute(p).
string());
+
+
-
-
-
485 if (strTemp ==
"main")
-
-
487 else if (strTemp ==
"testnet")
-
-
489 else if (strTemp ==
"devnet")
-
-
-
492 NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
-
-
-
-
-
-
-
-
500 PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
-
-
-
-
-
-
-
507 peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
508 if (*peers_in_max > 1000)
-
509 Throw<std::runtime_error>(
"Invalid value specified in [" SECTION_PEERS_IN_MAX
-
510 "] section; the value must be less or equal than 1000");
-
-
-
-
-
-
516 peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
517 if (*peers_out_max < 10 || *peers_out_max > 1000)
-
518 Throw<std::runtime_error>(
"Invalid value specified in [" SECTION_PEERS_OUT_MAX
-
519 "] section; the value must be in range 10-1000");
-
-
-
-
523 if ((peers_in_max && !peers_out_max) || (peers_out_max && !peers_in_max))
-
524 Throw<std::runtime_error>(
"Both sections [" SECTION_PEERS_IN_MAX
-
-
526 "and [" SECTION_PEERS_OUT_MAX
"] must be configured");
-
-
528 if (peers_in_max && peers_out_max)
-
-
-
-
-
-
-
-
-
537 if (boost::iequals(strTemp,
"tiny"))
-
-
539 else if (boost::iequals(strTemp,
"small"))
-
-
541 else if (boost::iequals(strTemp,
"medium"))
-
-
543 else if (boost::iequals(strTemp,
"large"))
-
-
545 else if (boost::iequals(strTemp,
"huge"))
-
-
-
-
-
-
-
-
-
-
555 ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
-
-
-
-
-
-
561 SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
-
-
-
-
565 if (boost::iequals(strTemp,
"all"))
-
-
567 else if (boost::iequals(strTemp,
"trusted"))
-
-
569 else if (boost::iequals(strTemp,
"drop_untrusted"))
-
-
-
572 Throw<std::runtime_error>(
"Invalid value specified in [" SECTION_RELAY_VALIDATIONS
"] section");
-
-
-
-
-
577 if (boost::iequals(strTemp,
"all"))
-
-
579 else if (boost::iequals(strTemp,
"trusted"))
-
-
581 else if (boost::iequals(strTemp,
"drop_untrusted"))
-
-
-
584 Throw<std::runtime_error>(
"Invalid value specified in [" SECTION_RELAY_PROPOSALS
"] section");
-
-
-
587 if (
exists(SECTION_VALIDATION_SEED) &&
exists(SECTION_VALIDATOR_TOKEN))
-
588 Throw<std::runtime_error>(
"Cannot have both [" SECTION_VALIDATION_SEED
"] and [" SECTION_VALIDATOR_TOKEN
-
589 "] config sections");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
603 if (boost::iequals(strTemp,
"full"))
-
-
605 else if (boost::iequals(strTemp,
"none"))
-
-
-
-
-
-
-
-
613 if (boost::iequals(strTemp,
"none"))
-
-
615 else if (boost::iequals(strTemp,
"full"))
-
-
-
618 FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
-
-
-
-
-
-
-
626 if (
exists(SECTION_VALIDATION_SEED) ||
exists(SECTION_VALIDATOR_TOKEN))
-
-
-
-
-
-
632 PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
-
-
-
-
-
-
-
-
-
-
-
-
-
645 if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
-
646 Throw<std::runtime_error>(
"Invalid " SECTION_SWEEP_INTERVAL
": must be between 10 and 600 inclusive");
-
-
-
-
-
651 WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
-
653 if (WORKERS < 1 || WORKERS > 1024)
-
654 Throw<std::runtime_error>(
"Invalid " SECTION_WORKERS
": must be between 1 and 1024 inclusive.");
-
-
-
-
-
659 IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
-
661 if (IO_WORKERS < 1 || IO_WORKERS > 1024)
-
662 Throw<std::runtime_error>(
"Invalid " SECTION_IO_WORKERS
": must be between 1 and 1024 inclusive.");
-
-
-
-
-
-
-
669 if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
-
670 Throw<std::runtime_error>(
"Invalid " SECTION_PREFETCH_WORKERS
": must be between 1 and 1024 inclusive.");
-
-
-
-
674 COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
-
-
-
-
-
679 if (
exists(SECTION_REDUCE_RELAY))
-
-
681 auto sec =
section(SECTION_REDUCE_RELAY);
-
-
-
-
-
-
-
689 if (sec.exists(
"vp_base_squelch_enable") && sec.exists(
"vp_enable"))
-
690 Throw<std::runtime_error>(
"Invalid " SECTION_REDUCE_RELAY
-
691 " cannot specify both vp_base_squelch_enable and vp_enable "
-
-
693 "vp_enable was deprecated and replaced by "
-
694 "vp_base_squelch_enable");
-
-
696 if (sec.exists(
"vp_base_squelch_enable"))
-
-
698 else if (sec.exists(
"vp_enable"))
-
-
-
-
-
-
-
-
-
-
710 Throw<std::runtime_error>(
"Invalid " SECTION_REDUCE_RELAY
-
711 " vp_base_squelch_max_selected_peers must be "
-
712 "greater than or equal to 3");
-
-
-
-
-
-
-
720 Throw<std::runtime_error>(
"Invalid " SECTION_REDUCE_RELAY
-
721 ", tx_min_peers must be greater than or equal to 10"
-
722 ", tx_relay_percentage must be greater than or equal to 10 "
-
723 "and less than or equal to 100");
-
-
-
-
-
-
-
-
-
-
-
-
735 Throw<std::runtime_error>(
"Invalid " SECTION_SERVER_DOMAIN
-
736 ": the domain name does not appear to meet the requirements.");
-
-
-
-
-
-
742 if (
exists(SECTION_OVERLAY))
-
-
744 auto const sec =
section(SECTION_OVERLAY);
-
-
+
+
+
+
+
487 if (strTemp ==
"main")
+
+
489 else if (strTemp ==
"testnet")
+
+
491 else if (strTemp ==
"devnet")
+
+
+
494 NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
+
+
+
+
+
+
+
+
502 PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
+
+
+
+
+
+
+
509 peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
510 if (*peers_in_max > 1000)
+
511 Throw<std::runtime_error>(
"Invalid value specified in [" SECTION_PEERS_IN_MAX
+
512 "] section; the value must be less or equal than 1000");
+
+
+
+
+
+
518 peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
519 if (*peers_out_max < 10 || *peers_out_max > 1000)
+
520 Throw<std::runtime_error>(
"Invalid value specified in [" SECTION_PEERS_OUT_MAX
+
521 "] section; the value must be in range 10-1000");
+
+
+
+
525 if ((peers_in_max && !peers_out_max) || (peers_out_max && !peers_in_max))
+
526 Throw<std::runtime_error>(
"Both sections [" SECTION_PEERS_IN_MAX
+
+
528 "and [" SECTION_PEERS_OUT_MAX
"] must be configured");
+
+
530 if (peers_in_max && peers_out_max)
+
+
+
+
+
+
+
+
+
539 if (boost::iequals(strTemp,
"tiny"))
+
+
541 else if (boost::iequals(strTemp,
"small"))
+
+
543 else if (boost::iequals(strTemp,
"medium"))
+
+
545 else if (boost::iequals(strTemp,
"large"))
+
+
547 else if (boost::iequals(strTemp,
"huge"))
+
+
+
+
+
+
+
+
+
+
557 ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
+
+
+
+
+
+
563 SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
+
+
+
+
567 if (boost::iequals(strTemp,
"all"))
+
+
569 else if (boost::iequals(strTemp,
"trusted"))
+
+
571 else if (boost::iequals(strTemp,
"drop_untrusted"))
+
+
+
574 Throw<std::runtime_error>(
"Invalid value specified in [" SECTION_RELAY_VALIDATIONS
"] section");
+
+
+
+
+
579 if (boost::iequals(strTemp,
"all"))
+
+
581 else if (boost::iequals(strTemp,
"trusted"))
+
+
583 else if (boost::iequals(strTemp,
"drop_untrusted"))
+
+
+
586 Throw<std::runtime_error>(
"Invalid value specified in [" SECTION_RELAY_PROPOSALS
"] section");
+
+
+
589 if (
exists(SECTION_VALIDATION_SEED) &&
exists(SECTION_VALIDATOR_TOKEN))
+
590 Throw<std::runtime_error>(
"Cannot have both [" SECTION_VALIDATION_SEED
"] and [" SECTION_VALIDATOR_TOKEN
+
591 "] config sections");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
605 if (boost::iequals(strTemp,
"full"))
+
+
607 else if (boost::iequals(strTemp,
"none"))
+
+
+
+
+
+
+
+
615 if (boost::iequals(strTemp,
"none"))
+
+
617 else if (boost::iequals(strTemp,
"full"))
+
+
+
620 FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
+
+
+
+
+
+
+
628 if (
exists(SECTION_VALIDATION_SEED) ||
exists(SECTION_VALIDATOR_TOKEN))
+
+
+
+
+
+
634 PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
+
+
+
+
+
+
+
+
+
+
+
+
+
647 if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
+
648 Throw<std::runtime_error>(
"Invalid " SECTION_SWEEP_INTERVAL
": must be between 10 and 600 inclusive");
+
+
+
+
+
653 WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
+
655 if (WORKERS < 1 || WORKERS > 1024)
+
656 Throw<std::runtime_error>(
"Invalid " SECTION_WORKERS
": must be between 1 and 1024 inclusive.");
+
+
+
+
+
661 IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
+
663 if (IO_WORKERS < 1 || IO_WORKERS > 1024)
+
664 Throw<std::runtime_error>(
"Invalid " SECTION_IO_WORKERS
": must be between 1 and 1024 inclusive.");
+
+
+
+
+
+
+
671 if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
+
672 Throw<std::runtime_error>(
"Invalid " SECTION_PREFETCH_WORKERS
": must be between 1 and 1024 inclusive.");
+
+
+
+
676 COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
+
+
+
+
+
681 if (
exists(SECTION_REDUCE_RELAY))
+
+
683 auto sec =
section(SECTION_REDUCE_RELAY);
+
+
+
+
+
+
+
691 if (sec.exists(
"vp_base_squelch_enable") && sec.exists(
"vp_enable"))
+
692 Throw<std::runtime_error>(
"Invalid " SECTION_REDUCE_RELAY
+
693 " cannot specify both vp_base_squelch_enable and vp_enable "
+
+
695 "vp_enable was deprecated and replaced by "
+
696 "vp_base_squelch_enable");
+
+
698 if (sec.exists(
"vp_base_squelch_enable"))
+
+
700 else if (sec.exists(
"vp_enable"))
+
+
+
+
+
+
+
+
+
+
712 Throw<std::runtime_error>(
"Invalid " SECTION_REDUCE_RELAY
+
713 " vp_base_squelch_max_selected_peers must be "
+
714 "greater than or equal to 3");
+
+
+
+
+
+
+
722 Throw<std::runtime_error>(
"Invalid " SECTION_REDUCE_RELAY
+
723 ", tx_min_peers must be greater than or equal to 10"
+
724 ", tx_relay_percentage must be greater than or equal to 10 "
+
725 "and less than or equal to 100");
+
+
+
+
+
+
+
+
+
+
+
+
737 Throw<std::runtime_error>(
"Invalid " SECTION_SERVER_DOMAIN
+
738 ": the domain name does not appear to meet the requirements.");
+
+
+
+
+
+
744 if (
exists(SECTION_OVERLAY))
+
+
746 auto const sec =
section(SECTION_OVERLAY);
-
-
-
750 if (
auto val = sec.get(
"max_unknown_time"))
-
-
-
-
-
755 Throw<std::runtime_error>(
"Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
756 ": must be of the form '<number>' representing seconds.");
-
-
-
-
760 Throw<std::runtime_error>(
"Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
761 ": the time must be between 300 and 1800 seconds, inclusive.");
-
-
-
-
765 if (
auto val = sec.get(
"max_diverged_time"))
-
-
-
-
-
770 Throw<std::runtime_error>(
"Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
771 ": must be of the form '<number>' representing seconds.");
-
-
-
-
-
776 Throw<std::runtime_error>(
"Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
777 ": the time must be between 60 and 900 seconds, inclusive.");
-
-
-
-
-
-
-
784 boost::regex
const re(
"^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
-
-
786 if (!boost::regex_match(strTemp,
match, re))
-
787 Throw<std::runtime_error>(
"Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
788 ", must be: [0-9]+ [minutes|hours|days|weeks]");
-
-
+
+
+
+
+
752 if (
auto val = sec.get(
"max_unknown_time"))
+
+
+
+
+
757 Throw<std::runtime_error>(
"Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
758 ": must be of the form '<number>' representing seconds.");
+
+
+
+
762 Throw<std::runtime_error>(
"Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
763 ": the time must be between 300 and 1800 seconds, inclusive.");
+
+
+
+
767 if (
auto val = sec.get(
"max_diverged_time"))
+
+
+
+
+
772 Throw<std::runtime_error>(
"Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
773 ": must be of the form '<number>' representing seconds.");
+
+
+
+
+
778 Throw<std::runtime_error>(
"Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
779 ": the time must be between 60 and 900 seconds, inclusive.");
+
+
+
+
+
+
+
786 boost::regex
const re(
"^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
+
+
788 if (!boost::regex_match(strTemp,
match, re))
+
789 Throw<std::runtime_error>(
"Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
790 ", must be: [0-9]+ [minutes|hours|days|weeks]");
-
792 if (boost::iequals(
match[2],
"minutes"))
-
-
794 else if (boost::iequals(
match[2],
"hours"))
-
-
796 else if (boost::iequals(
match[2],
"days"))
-
-
798 else if (boost::iequals(
match[2],
"weeks"))
-
-
-
-
802 Throw<std::runtime_error>(
"Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
803 ", the minimum amount of time an amendment must hold a "
-
804 "majority is 15 minutes");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
821 boost::filesystem::path validatorsFile;
-
-
-
-
825 validatorsFile = strTemp;
-
-
827 if (validatorsFile.empty())
-
828 Throw<std::runtime_error>(
"Invalid path specified in [" SECTION_VALIDATORS_FILE
"]");
-
-
830 if (!validatorsFile.is_absolute() && !
CONFIG_DIR.empty())
-
-
-
833 if (!boost::filesystem::exists(validatorsFile))
-
834 Throw<std::runtime_error>(
-
835 "The file specified in [" SECTION_VALIDATORS_FILE
-
-
-
838 validatorsFile.string());
-
-
-
841 !boost::filesystem::is_regular_file(validatorsFile) && !boost::filesystem::is_symlink(validatorsFile))
-
842 Throw<std::runtime_error>(
-
843 "Invalid file specified in [" SECTION_VALIDATORS_FILE
"]: " + validatorsFile.string());
-
-
-
-
-
-
849 if (!validatorsFile.empty())
-
-
851 if (!boost::filesystem::exists(validatorsFile))
-
852 validatorsFile.clear();
-
-
854 !boost::filesystem::is_regular_file(validatorsFile) &&
-
855 !boost::filesystem::is_symlink(validatorsFile))
-
856 validatorsFile.clear();
-
-
-
-
860 if (!validatorsFile.empty() && boost::filesystem::exists(validatorsFile) &&
-
861 (boost::filesystem::is_regular_file(validatorsFile) || boost::filesystem::is_symlink(validatorsFile)))
-
-
863 boost::system::error_code ec;
-
-
-
-
867 Throw<std::runtime_error>(
-
868 "Failed to read '" + validatorsFile.string() +
"'." +
std::to_string(ec.value()) +
": " +
-
-
-
-
+
+
+
794 if (boost::iequals(
match[2],
"minutes"))
+
+
796 else if (boost::iequals(
match[2],
"hours"))
+
+
798 else if (boost::iequals(
match[2],
"days"))
+
+
800 else if (boost::iequals(
match[2],
"weeks"))
+
+
+
+
804 Throw<std::runtime_error>(
"Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
805 ", the minimum amount of time an amendment must hold a "
+
806 "majority is 15 minutes");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
823 boost::filesystem::path validatorsFile;
+
+
+
+
827 validatorsFile = strTemp;
+
+
829 if (validatorsFile.empty())
+
830 Throw<std::runtime_error>(
"Invalid path specified in [" SECTION_VALIDATORS_FILE
"]");
+
+
832 if (!validatorsFile.is_absolute() && !
CONFIG_DIR.empty())
+
+
+
835 if (!boost::filesystem::exists(validatorsFile))
+
836 Throw<std::runtime_error>(
+
837 "The file specified in [" SECTION_VALIDATORS_FILE
+
+
+
840 validatorsFile.string());
+
+
+
843 !boost::filesystem::is_regular_file(validatorsFile) && !boost::filesystem::is_symlink(validatorsFile))
+
844 Throw<std::runtime_error>(
+
845 "Invalid file specified in [" SECTION_VALIDATORS_FILE
"]: " + validatorsFile.string());
+
+
+
+
+
+
851 if (!validatorsFile.empty())
+
+
853 if (!boost::filesystem::exists(validatorsFile))
+
854 validatorsFile.clear();
+
+
856 !boost::filesystem::is_regular_file(validatorsFile) &&
+
857 !boost::filesystem::is_symlink(validatorsFile))
+
858 validatorsFile.clear();
+
+
+
+
862 if (!validatorsFile.empty() && boost::filesystem::exists(validatorsFile) &&
+
863 (boost::filesystem::is_regular_file(validatorsFile) || boost::filesystem::is_symlink(validatorsFile)))
+
+
865 boost::system::error_code ec;
+
+
+
+
869 Throw<std::runtime_error>(
+
870 "Failed to read '" + validatorsFile.string() +
"'." +
std::to_string(ec.value()) +
": " +
+
+
-
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
887 section(SECTION_VALIDATOR_LIST_SITES).
append(*valSiteEntries);
-
-
+
+
+
+
889 section(SECTION_VALIDATOR_LIST_SITES).
append(*valSiteEntries);
-
-
-
-
894 auto valListThreshold =
getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_THRESHOLD);
+
+
+
+
-
896 if (valListThreshold)
-
897 section(SECTION_VALIDATOR_LIST_THRESHOLD).
append(*valListThreshold);
-
-
899 if (!entries && !valKeyEntries && !valListKeys)
-
900 Throw<std::runtime_error>(
-
901 "The file specified in [" SECTION_VALIDATORS_FILE
-
-
903 "does not contain a [" SECTION_VALIDATORS
-
-
905 "[" SECTION_VALIDATOR_KEYS
-
-
907 "[" SECTION_VALIDATOR_LIST_KEYS
-
-
-
910 validatorsFile.string());
-
-
-
-
914 auto const& listThreshold =
section(SECTION_VALIDATOR_LIST_THRESHOLD);
-
915 if (listThreshold.lines().empty())
-
-
917 else if (listThreshold.values().size() == 1)
-
-
919 auto strTemp = listThreshold.values()[0];
-
920 auto const listThreshold = beast::lexicalCastThrow<std::size_t>(strTemp);
-
921 if (listThreshold == 0)
-
-
923 else if (listThreshold >
section(SECTION_VALIDATOR_LIST_KEYS).values().size())
-
-
925 Throw<std::runtime_error>(
-
926 "Value in config section "
-
927 "[" SECTION_VALIDATOR_LIST_THRESHOLD
"] exceeds the number of configured list keys");
-
-
929 return listThreshold;
-
-
-
-
933 Throw<std::runtime_error>(
-
-
935 "[" SECTION_VALIDATOR_LIST_THRESHOLD
"] should contain single value only");
-
-
-
-
-
-
-
942 if (!
section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
-
943 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
-
-
945 Throw<std::runtime_error>(
"[" +
std::string(SECTION_VALIDATOR_LIST_KEYS) +
"] config section is missing");
-
-
-
-
-
950 auto const part =
section(
"features");
-
951 for (
auto const& s : part.values())
-
-
-
-
-
956 Throw<std::runtime_error>(
"Unknown feature: " + s +
" in config file.");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
972 Throw<std::runtime_error>(
-
973 "The minimum number of required peers (network_quorum) exceeds "
-
974 "the maximum number of allowed peers (peers_max)");
-
-
-
+
896 auto valListThreshold =
getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_THRESHOLD);
+
+
898 if (valListThreshold)
+
899 section(SECTION_VALIDATOR_LIST_THRESHOLD).
append(*valListThreshold);
+
+
901 if (!entries && !valKeyEntries && !valListKeys)
+
902 Throw<std::runtime_error>(
+
903 "The file specified in [" SECTION_VALIDATORS_FILE
+
+
905 "does not contain a [" SECTION_VALIDATORS
+
+
907 "[" SECTION_VALIDATOR_KEYS
+
+
909 "[" SECTION_VALIDATOR_LIST_KEYS
+
+
+
912 validatorsFile.string());
+
+
+
+
916 auto const& listThreshold =
section(SECTION_VALIDATOR_LIST_THRESHOLD);
+
917 if (listThreshold.lines().empty())
+
+
919 else if (listThreshold.values().size() == 1)
+
+
921 auto strTemp = listThreshold.values()[0];
+
922 auto const listThreshold = beast::lexicalCastThrow<std::size_t>(strTemp);
+
923 if (listThreshold == 0)
+
+
925 else if (listThreshold >
section(SECTION_VALIDATOR_LIST_KEYS).values().size())
+
+
927 Throw<std::runtime_error>(
+
928 "Value in config section "
+
929 "[" SECTION_VALIDATOR_LIST_THRESHOLD
"] exceeds the number of configured list keys");
+
+
931 return listThreshold;
+
+
+
+
935 Throw<std::runtime_error>(
+
+
937 "[" SECTION_VALIDATOR_LIST_THRESHOLD
"] should contain single value only");
+
+
+
+
+
+
+
944 if (!
section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
+
945 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
+
+
947 Throw<std::runtime_error>(
"[" +
std::string(SECTION_VALIDATOR_LIST_KEYS) +
"] config section is missing");
+
+
+
+
+
952 auto const part =
section(
"features");
+
953 for (
auto const& s : part.values())
+
+
+
+
+
958 Throw<std::runtime_error>(
"Unknown feature: " + s +
" in config file.");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
974 Throw<std::runtime_error>(
+
975 "The minimum number of required peers (network_quorum) exceeds "
+
976 "the maximum number of allowed peers (peers_max)");
+
+
+