diff options
| author | tobtoht <tob@featherwallet.org> | 2026-04-22 20:32:57 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2026-04-22 20:32:57 +0000 |
| commit | 9d0c50fab5bd7373b636bca29611c78cf97f28d3 (patch) | |
| tree | 9588344eb939fd227206fe7829083a2d3b974c14 /src/cryptonote_core/cryptonote_core.cpp | |
| parent | b73668263df04a96c5bc812bbb5ca72f9b392a17 (diff) | |
| parent | 8a20fd2bc84d74917381fb50362b4d1a385256bd (diff) | |
| download | monzero-core-9d0c50fab5bd7373b636bca29611c78cf97f28d3.tar.gz monzero-core-9d0c50fab5bd7373b636bca29611c78cf97f28d3.tar.xz monzero-core-9d0c50fab5bd7373b636bca29611c78cf97f28d3.zip | |
Merge pull request #10444
8a20fd2 blockchain_utilities: fix --data-dir option (jeffro256)
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); |
