Skip to content

Commit

Permalink
Fix p2p node default config and update node pub key when priv key is …
Browse files Browse the repository at this point in the history
…updated #1979
  • Loading branch information
mvandeberg committed Feb 14, 2018
1 parent ed7abf4 commit 28ab353
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions libraries/net/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5012,6 +5012,9 @@ namespace graphene { namespace net {
_node_configuration.private_key = fc::ecc::private_key::generate();
}

// Private key could have been overridden at this point. Update public key just in case
_node_public_key = _node_configuration.private_key.get_public_key().serialize();

if( _node_configuration.desired_number_of_connections > _node_configuration.maximum_number_of_connections )
{
wlog( "Reducing desired_number_of_connections from ${x0} to maximum_number_of_connections=${x1}",
Expand Down
2 changes: 1 addition & 1 deletion libraries/plugins/p2p/p2p_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void p2p_plugin::set_program_options( bpo::options_description& cli, bpo::option
("p2p-max-connections", bpo::value<uint32_t>(), "Maxmimum number of incoming connections on P2P endpoint.")
("seed-node", bpo::value<vector<string>>()->composing(), "The IP address and port of a remote peer to sync with. Deprecated in favor of p2p-seed-node.")
("p2p-seed-node", bpo::value<vector<string>>()->composing(), "The IP address and port of a remote peer to sync with.")
("p2p-parameters", bpo::value<string>()->default_value(fc::json::to_string(graphene::net::node_configuration())), "P2P network parameters")
("p2p-parameters", bpo::value<string>(), ("P2P network parameters. (Default: " + fc::json::to_string(graphene::net::node_configuration()) + " )").c_str() )
;
cli.add_options()
("force-validate", bpo::bool_switch()->default_value(false), "Force validation of all transactions. Deprecated in favor of p2p-force-validate" )
Expand Down

0 comments on commit 28ab353

Please sign in to comment.