aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortobtoht <tob@featherwallet.org>2026-04-18 08:13:55 +0000
committertobtoht <tob@featherwallet.org>2026-04-18 08:13:55 +0000
commite75125a30b1f70e74eded99d3fc4f3e98938c6d5 (patch)
tree0f58753a74695a84c378bf76da122f773f956154 /src
parentecb1b7148e8ce3e5bc2b98cd5f93629d61486fc5 (diff)
parent1d2ae2138a85dd93bc8a0d2c55513c5b5ba4658f (diff)
downloadmonzero-core-e75125a30b1f70e74eded99d3fc4f3e98938c6d5.tar.gz
monzero-core-e75125a30b1f70e74eded99d3fc4f3e98938c6d5.tar.xz
monzero-core-e75125a30b1f70e74eded99d3fc4f3e98938c6d5.zip
Merge pull request #10410
1d2ae21 p2p: isolate regtest from mainnet bootstrap state (Jeetraj)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp14
-rw-r--r--src/cryptonote_core/cryptonote_core.h2
-rw-r--r--src/p2p/net_node.inl7
3 files changed, 14 insertions, 9 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 627f11450..4bada999f 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -97,16 +97,18 @@ namespace cryptonote
, "Fixed difficulty used for testing."
, 0
};
- const command_line::arg_descriptor<std::string, false, true, 2> arg_data_dir = {
+ const command_line::arg_descriptor<std::string, false, true, 3> arg_data_dir = {
"data-dir"
, "Specify data directory"
, tools::get_default_data_dir()
- , {{ &arg_testnet_on, &arg_stagenet_on }}
- , [](std::array<bool, 2> testnet_stagenet, bool defaulted, std::string val)->std::string {
- if (testnet_stagenet[0])
+ , {{ &arg_testnet_on, &arg_stagenet_on, &arg_regtest_on }}
+ , [](std::array<bool, 3> nets, bool defaulted, std::string val)->std::string {
+ if (nets[0])
return (boost::filesystem::path(val) / "testnet").string();
- else if (testnet_stagenet[1])
+ else if (nets[1])
return (boost::filesystem::path(val) / "stagenet").string();
+ else if (nets[2])
+ return (boost::filesystem::path(val) / "fake").string();
return val;
}
};
@@ -474,8 +476,6 @@ namespace cryptonote
bool keep_fakechain = command_line::get_arg(vm, arg_keep_fakechain);
boost::filesystem::path folder(m_config_folder);
- if (m_nettype == FAKECHAIN)
- folder /= "fake";
// make sure the data directory exists, and try to lock it
CHECK_AND_ASSERT_MES (boost::filesystem::exists(folder) || boost::filesystem::create_directories(folder), false,
diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h
index f1339dbb9..7806fe495 100644
--- a/src/cryptonote_core/cryptonote_core.h
+++ b/src/cryptonote_core/cryptonote_core.h
@@ -63,7 +63,7 @@ namespace cryptonote
const size_t long_term_block_weight_window;
};
- extern const command_line::arg_descriptor<std::string, false, true, 2> arg_data_dir;
+ extern const command_line::arg_descriptor<std::string, false, true, 3> arg_data_dir;
extern const command_line::arg_descriptor<bool, false> arg_testnet_on;
extern const command_line::arg_descriptor<bool, false> arg_stagenet_on;
extern const command_line::arg_descriptor<bool, false> arg_regtest_on;
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index bca8a52af..9bfe83eed 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -431,8 +431,9 @@ namespace nodetool
{
bool testnet = command_line::get_arg(vm, cryptonote::arg_testnet_on);
bool stagenet = command_line::get_arg(vm, cryptonote::arg_stagenet_on);
+ bool regtest = command_line::get_arg(vm, cryptonote::arg_regtest_on);
const bool pad_txs = command_line::get_arg(vm, arg_pad_transactions);
- m_nettype = testnet ? cryptonote::TESTNET : stagenet ? cryptonote::STAGENET : cryptonote::MAINNET;
+ m_nettype = testnet ? cryptonote::TESTNET : stagenet ? cryptonote::STAGENET : regtest ? cryptonote::FAKECHAIN : cryptonote::MAINNET;
network_zone& public_zone = m_network_zones[epee::net_utils::zone::public_];
public_zone.m_connect = &public_connect;
@@ -777,6 +778,10 @@ namespace nodetool
{
return get_ip_seed_nodes();
}
+ if (m_nettype == cryptonote::FAKECHAIN)
+ {
+ return {};
+ }
if (!m_enable_dns_seed_nodes)
{
// TODO: a domain can be set through socks, so that the remote side does the lookup for the DNS seed nodes.