Pulling nano::network_constants reference through ipc_config_tcp_socket rather than instantiating it statically.
This commit is contained in:
parent
238ae671e1
commit
cad65ee436
2 changed files with 9 additions and 3 deletions
|
@ -52,11 +52,12 @@ namespace ipc
|
|||
class ipc_config_tcp_socket : public ipc_config_transport
|
||||
{
|
||||
public:
|
||||
ipc_config_tcp_socket () :
|
||||
port (network_constants.default_ipc_port)
|
||||
ipc_config_tcp_socket (nano::network_constants & network_constants) :
|
||||
network_constants{ network_constants },
|
||||
port{ network_constants.default_ipc_port }
|
||||
{
|
||||
}
|
||||
nano::network_constants network_constants;
|
||||
nano::network_constants & network_constants;
|
||||
/** Listening port */
|
||||
uint16_t port;
|
||||
};
|
||||
|
@ -65,6 +66,10 @@ namespace ipc
|
|||
class ipc_config
|
||||
{
|
||||
public:
|
||||
ipc_config (nano::network_constants & network_constants) :
|
||||
transport_tcp{ network_constants }
|
||||
{
|
||||
}
|
||||
nano::error deserialize_json (bool & upgraded_a, nano::jsonconfig & json_a);
|
||||
nano::error serialize_json (nano::jsonconfig & json) const;
|
||||
nano::error deserialize_toml (nano::tomlconfig & toml_a);
|
||||
|
|
|
@ -30,6 +30,7 @@ nano::node_config::node_config (uint16_t peering_port_a, nano::logging const & l
|
|||
peering_port{ peering_port_a },
|
||||
logging{ logging_a },
|
||||
websocket_config{ network_params.network },
|
||||
ipc_config{ network_params.network },
|
||||
external_address{ boost::asio::ip::address_v6{}.to_string () }
|
||||
{
|
||||
// The default constructor passes 0 to indicate we should use the default port,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue