diff --git a/plugins/net_plugin/include/eosio/net_plugin/address_manager.hpp b/plugins/net_plugin/include/eosio/net_plugin/address_manager.hpp index 7e1b9c5056..cca2e23ab0 100644 --- a/plugins/net_plugin/include/eosio/net_plugin/address_manager.hpp +++ b/plugins/net_plugin/include/eosio/net_plugin/address_manager.hpp @@ -103,13 +103,15 @@ namespace eosio { // for IPV6 "[::]:port" address string::size_type p = address_str[0] == '[' ? address_str.find(']') : 0; - - //host and port is necessary if (p == string::npos) { throw std::invalid_argument(input_address_str); } string::size_type colon = address_str.find(':', p); + //host and port is necessary + if (colon == string::npos) { + throw std::invalid_argument(input_address_str); + } string::size_type colon2 = address_str.find(':', colon + 1); string::size_type end = colon2 == string::npos ? string::npos : address_str.find_first_of( " :+=.,<>!$%^&(*)|-#@\t", colon2 + 1 ); diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 70ddc51a08..cc692b1748 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -4255,8 +4255,8 @@ namespace eosio { " p2p.eos.io:9876\n" " p2p.trx.eos.io:9876:trx\n" " p2p.blk.eos.io:9876:blk\n") - ( "p2p-max-nodes-per-host", bpo::value()->default_value(def_max_nodes_per_host), "Maximum number of client nodes from any single IP address") - ( "p2p-max-addresses-per-request", bpo::value()->default_value(def_max_address_per_request), "Maximum number of addresses in address request or sync message") + ( "p2p-max-nodes-per-host", bpo::value()->default_value(def_max_nodes_per_host), "Maximum number of client nodes from any single IP address") + ( "p2p-max-addresses-per-request", bpo::value()->default_value(def_max_address_per_request), "Maximum number of addresses in address request or sync message") ( "p2p-accept-transactions", bpo::value()->default_value(true), "Allow transactions received over p2p network to be evaluated and relayed if valid.") ( "p2p-only-send-manual-addresses", bpo::value()->default_value(false), "Only send addresses from configuration instead from automated peer discovery") ( "p2p-auto-bp-peer", bpo::value< vector >()->composing(), @@ -4310,25 +4310,23 @@ namespace eosio { peer_log_format = options.at( "peer-log-format" ).as(); - //init address manager, timeout function is yet to be implemented address_master = std::make_unique(0); - max_addresses_per_request = options.at("p2p-max-addresses-per-request").as(); + max_addresses_per_request = options.at("p2p-max-addresses-per-request").as(); p2p_only_send_manual_addresses = options.at("p2p-only-send-manual-addresses").as(); - min_peers_count = options.at( "min-peers" ).as(); + min_peers_count = options.at( "min-peers" ).as(); sync_master = std::make_unique( options.at( "sync-fetch-span" ).as(), options.at( "sync-peer-limit" ).as() ); - + txn_exp_period = def_txn_expire_wait; p2p_dedup_cache_expire_time_us = fc::seconds( options.at( "p2p-dedup-cache-expire-time-sec" ).as() ); resp_expected_period = def_resp_expected_wait; - max_nodes_per_host = options.at( "p2p-max-nodes-per-host" ).as(); + max_nodes_per_host = options.at( "p2p-max-nodes-per-host" ).as(); p2p_accept_transactions = options.at( "p2p-accept-transactions" ).as(); - use_socket_read_watermark = options.at( "use-socket-read-watermark" ).as(); keepalive_interval = std::chrono::milliseconds( options.at( "p2p-keepalive-interval-ms" ).as() ); EOS_ASSERT( keepalive_interval.count() > 0, chain::plugin_config_exception, @@ -4339,7 +4337,7 @@ namespace eosio { std::chrono::seconds( options.at("connection-cleanup-period").as() ), options.at("max-clients").as() ); - if( options.count( "p2p-listen-endpoint" )) { + if( options.count( "p2p-listen-endpoint" )) { auto p2ps = options.at("p2p-listen-endpoint").as>(); if (!p2ps.front().empty()) { p2p_addresses = p2ps;