diff options
| author | jeffro256 <jeffro256@tutanota.com> | 2026-04-22 00:27:53 -0500 |
|---|---|---|
| committer | jeffro256 <jeffro256@tutanota.com> | 2026-04-22 00:34:02 -0500 |
| commit | 8a20fd2bc84d74917381fb50362b4d1a385256bd (patch) | |
| tree | 652e459985638070bb078441f08c8099d3e68052 /src/cryptonote_core/cryptonote_core.cpp | |
| parent | 8b6be66bef8cce6e074074b7329be9509b93dbb8 (diff) | |
| download | monzero-core-8a20fd2bc84d74917381fb50362b4d1a385256bd.tar.gz monzero-core-8a20fd2bc84d74917381fb50362b4d1a385256bd.tar.xz monzero-core-8a20fd2bc84d74917381fb50362b4d1a385256bd.zip | |
blockchain_utilities: fix --data-dir option
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 4bada999f..18625de98 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -346,13 +346,21 @@ namespace cryptonote BlockchainDB::init_options(desc); } //----------------------------------------------------------------------------------------------- + network_type core::get_network_type_from_args(const boost::program_options::variables_map& vm) + { + const bool testnet = command_line::get_arg(vm, arg_testnet_on); + const bool stagenet = command_line::get_arg(vm, arg_stagenet_on); + const bool regtest = command_line::get_arg(vm, arg_regtest_on); + if (testnet + stagenet + regtest > 1) + throw std::runtime_error("More than one network type argument was specified"); + return testnet ? TESTNET : stagenet ? STAGENET : regtest ? FAKECHAIN : MAINNET; + } + //----------------------------------------------------------------------------------------------- bool core::handle_command_line(const boost::program_options::variables_map& vm) { if (m_nettype != FAKECHAIN) { - const bool testnet = command_line::get_arg(vm, arg_testnet_on); - const bool stagenet = command_line::get_arg(vm, arg_stagenet_on); - m_nettype = testnet ? TESTNET : stagenet ? STAGENET : MAINNET; + m_nettype = get_network_type_from_args(vm); } m_config_folder = command_line::get_arg(vm, arg_data_dir); |
