This is a fix where daemon_config was not switching its active network off of nano_dev_network. (#3422)
This commit is contained in:
parent
bb95786d87
commit
36c18747c3
9 changed files with 18 additions and 12 deletions
|
@ -69,7 +69,7 @@ TEST (toml, daemon_config_update_array)
|
|||
{
|
||||
nano::tomlconfig t;
|
||||
boost::filesystem::path data_path (".");
|
||||
nano::daemon_config c (data_path);
|
||||
nano::daemon_config c{ data_path, nano::dev::network_params };
|
||||
c.node.preconfigured_peers.push_back ("dev-peer.org");
|
||||
c.serialize_toml (t);
|
||||
c.deserialize_toml (t);
|
||||
|
|
|
@ -43,7 +43,8 @@ constexpr auto ipc_port_start = 62000;
|
|||
|
||||
void write_config_files (boost::filesystem::path const & data_path, int index)
|
||||
{
|
||||
nano::daemon_config daemon_config (data_path);
|
||||
nano::network_params network_params{ nano::network_constants::active_network };
|
||||
nano::daemon_config daemon_config{ data_path, network_params };
|
||||
daemon_config.node.peering_port = peering_port_start + index;
|
||||
daemon_config.node.ipc_config.transport_tcp.enabled = true;
|
||||
daemon_config.node.ipc_config.transport_tcp.port = ipc_port_start + index;
|
||||
|
|
|
@ -24,7 +24,7 @@ constexpr std::size_t OPEN_FILE_DESCRIPTORS_LIMIT = 16384;
|
|||
|
||||
static void load_and_set_bandwidth_params (std::shared_ptr<nano::node> const & node, boost::filesystem::path const & data_path, nano::node_flags const & flags)
|
||||
{
|
||||
nano::daemon_config config (data_path);
|
||||
nano::daemon_config config{ data_path, node->network_params };
|
||||
|
||||
auto error = nano::read_node_config_toml (data_path, config, flags.config_overrides);
|
||||
if (!error)
|
||||
|
@ -48,7 +48,8 @@ void nano_daemon::daemon::run (boost::filesystem::path const & data_path, nano::
|
|||
boost::system::error_code error_chmod;
|
||||
nano::set_secure_perm_directory (data_path, error_chmod);
|
||||
std::unique_ptr<nano::thread_runner> runner;
|
||||
nano::daemon_config config (data_path);
|
||||
nano::network_params network_params{ nano::network_constants::active_network };
|
||||
nano::daemon_config config{ data_path, network_params };
|
||||
auto error = nano::read_node_config_toml (data_path, config, flags.config_overrides);
|
||||
nano::set_use_memory_pools (config.node.use_memory_pools);
|
||||
if (!error)
|
||||
|
|
|
@ -1135,7 +1135,7 @@ int main (int argc, char * const * argv)
|
|||
{
|
||||
config_overrides = nano::config_overrides (config->second.as<std::vector<nano::config_key_value_pair>> ());
|
||||
}
|
||||
nano::daemon_config daemon_config (data_path);
|
||||
nano::daemon_config daemon_config{ data_path, network_params };
|
||||
auto error = nano::read_node_config_toml (data_path, daemon_config, config_overrides);
|
||||
|
||||
nano::node_config config1 = daemon_config.node;
|
||||
|
|
|
@ -79,7 +79,8 @@ int run_wallet (QApplication & application, int argc, char * const * argv, boost
|
|||
splash->showMessage (QSplashScreen::tr ("Remember - Back Up Your Wallet Seed"), Qt::AlignBottom | Qt::AlignHCenter, Qt::darkGray);
|
||||
application.processEvents ();
|
||||
|
||||
nano::daemon_config config (data_path);
|
||||
nano::network_params network_params{ nano::network_constants::active_network };
|
||||
nano::daemon_config config{ data_path, network_params };
|
||||
nano::wallet_config wallet_config;
|
||||
|
||||
auto error = nano::read_node_config_toml (data_path, config, flags.config_overrides);
|
||||
|
|
|
@ -658,7 +658,8 @@ std::error_code nano::handle_node_options (boost::program_options::variables_map
|
|||
if (type == "node")
|
||||
{
|
||||
valid_type = true;
|
||||
nano::daemon_config config (data_path);
|
||||
nano::network_params network_params{ nano::network_constants::active_network };
|
||||
nano::daemon_config config{ data_path, network_params };
|
||||
config.serialize_toml (toml);
|
||||
}
|
||||
else if (type == "rpc")
|
||||
|
@ -1311,7 +1312,8 @@ void reset_confirmation_heights (nano::write_transaction const & transaction, na
|
|||
|
||||
bool is_using_rocksdb (boost::filesystem::path const & data_path, boost::program_options::variables_map const & vm, std::error_code & ec)
|
||||
{
|
||||
nano::daemon_config config (data_path);
|
||||
nano::network_params network_params{ nano::network_constants::active_network };
|
||||
nano::daemon_config config{ data_path, network_params };
|
||||
|
||||
// Config overriding
|
||||
auto config_arg (vm.find ("config"));
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
nano::daemon_config::daemon_config (boost::filesystem::path const & data_path_a) :
|
||||
data_path (data_path_a)
|
||||
nano::daemon_config::daemon_config (boost::filesystem::path const & data_path_a, nano::network_params & network_params) :
|
||||
node{ network_params },
|
||||
data_path{ data_path_a }
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class daemon_config
|
|||
{
|
||||
public:
|
||||
daemon_config () = default;
|
||||
daemon_config (boost::filesystem::path const & data_path);
|
||||
daemon_config (boost::filesystem::path const & data_path, nano::network_params & network_params);
|
||||
nano::error deserialize_json (bool &, nano::jsonconfig &);
|
||||
nano::error serialize_json (nano::jsonconfig &);
|
||||
nano::error deserialize_toml (nano::tomlconfig &);
|
||||
|
|
|
@ -1772,7 +1772,7 @@ nano::node_wrapper::node_wrapper (boost::filesystem::path const & path_a, boost:
|
|||
*/
|
||||
boost::filesystem::create_directories (path_a);
|
||||
nano::set_secure_perm_directory (path_a, error_chmod);
|
||||
nano::daemon_config daemon_config (path_a);
|
||||
nano::daemon_config daemon_config{ path_a, nano::dev::network_params };
|
||||
auto error = nano::read_node_config_toml (config_path_a, daemon_config, node_flags_a.config_overrides);
|
||||
if (error)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue