Referencing network_constants by reference within websocket_config.
This commit is contained in:
parent
4a51d0ccec
commit
68f07fa276
3 changed files with 7 additions and 5 deletions
|
@ -29,6 +29,7 @@ nano::node_config::node_config (uint16_t peering_port_a, nano::logging const & l
|
|||
network_params{ network_params },
|
||||
peering_port{ peering_port_a },
|
||||
logging{ logging_a },
|
||||
websocket_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,
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
#include <nano/lib/tomlconfig.hpp>
|
||||
#include <nano/node/websocketconfig.hpp>
|
||||
|
||||
nano::websocket::config::config () :
|
||||
port (network_constants.default_websocket_port),
|
||||
address (boost::asio::ip::address_v6::loopback ().to_string ())
|
||||
nano::websocket::config::config (nano::network_constants & network_constants) :
|
||||
network_constants{ network_constants },
|
||||
port{ network_constants.default_websocket_port },
|
||||
address{ boost::asio::ip::address_v6::loopback ().to_string () }
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@ namespace websocket
|
|||
class config final
|
||||
{
|
||||
public:
|
||||
config ();
|
||||
config (nano::network_constants & network_constants);
|
||||
nano::error deserialize_json (nano::jsonconfig & json_a);
|
||||
nano::error serialize_json (nano::jsonconfig & json) const;
|
||||
nano::error deserialize_toml (nano::tomlconfig & toml_a);
|
||||
nano::error serialize_toml (nano::tomlconfig & toml) const;
|
||||
nano::network_constants network_constants;
|
||||
nano::network_constants & network_constants;
|
||||
bool enabled{ false };
|
||||
uint16_t port;
|
||||
std::string address;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue