From a19223bb260f7226f8a8a4987adccc04bf7369f0 Mon Sep 17 00:00:00 2001 From: chalith Date: Tue, 18 Oct 2022 15:19:57 +0530 Subject: [PATCH] Minor fixes --- src/conf.cpp | 4 ++-- src/hp_manager.cpp | 4 ++-- src/main.cpp | 2 +- src/msg/msg_common.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/conf.cpp b/src/conf.cpp index d1e34e0..d643cc1 100644 --- a/src/conf.cpp +++ b/src/conf.cpp @@ -60,8 +60,8 @@ namespace conf cfg.version = version::AGENT_VERSION; cfg.hp.host_address = host_addr.empty() ? "127.0.0.1" : std::string(host_addr); - cfg.hp.init_peer_port = init_peer_port; - cfg.hp.init_user_port = init_user_port; + cfg.hp.init_peer_port = !init_peer_port ? 22861 : init_peer_port; + cfg.hp.init_user_port = !init_user_port ? 26201 : init_user_port; cfg.system.max_instance_count = !inst_count ? 3 : inst_count; cfg.system.max_mem_kbytes = !ram_kbytes ? 1048576 : ram_kbytes; diff --git a/src/hp_manager.cpp b/src/hp_manager.cpp index f354bda..b9eb734 100644 --- a/src/hp_manager.cpp +++ b/src/hp_manager.cpp @@ -701,8 +701,8 @@ namespace hp if (config.contract.execute.has_value()) d["contract"]["execute"] = config.contract.execute.value(); - if (config.contract.environment.has_value()) - d["contract"]["environment"] = config.contract.environment.value(); + if (!config.contract.environment.empty()) + d["contract"]["environment"] = config.contract.environment; if (config.contract.max_input_ledger_offset.has_value()) d["contract"]["max_input_ledger_offset"] = config.contract.max_input_ledger_offset.value(); diff --git a/src/main.cpp b/src/main.cpp index 00704d5..86a03f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -132,7 +132,7 @@ int main(int argc, char **argv) // This will create a new config. const std::string host_addr = (argc >= 4) ? argv[3] : ""; - uint16_t init_peer_port, init_user_port, docker_registry_port = 0; + uint16_t init_peer_port = 0, init_user_port = 0, docker_registry_port = 0; size_t inst_count = 0, cpu_us = 0, ram_kbytes = 0, swap_kbytes = 0, disk_kbytes = 0; if (((argc >= 5) && util::stoul(argv[4], init_peer_port) != 0) || diff --git a/src/msg/msg_common.hpp b/src/msg/msg_common.hpp index 7b4a911..59578ff 100644 --- a/src/msg/msg_common.hpp +++ b/src/msg/msg_common.hpp @@ -63,7 +63,7 @@ namespace msg std::optional roundtime; std::set unl; std::optional execute; - std::optional> environment; + std::map environment; std::optional max_input_ledger_offset; c_log_config log; consensus_config consensus;