Rename nano/common.hpp to nano/endpoint.hpp and extract endpoint_templ.hpp template implementation file.
This commit is contained in:
		
					parent
					
						
							
								619a7f7e87
							
						
					
				
			
			
				commit
				
					
						d54e3d9915
					
				
			
		
					 40 changed files with 117 additions and 88 deletions
				
			
		| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
#include <nano/lib/blocks.hpp>
 | 
					#include <nano/lib/blocks.hpp>
 | 
				
			||||||
#include <nano/lib/stream.hpp>
 | 
					#include <nano/lib/stream.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/test_common/testutil.hpp>
 | 
					#include <nano/test_common/testutil.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <gtest/gtest.h>
 | 
					#include <gtest/gtest.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,7 +6,7 @@
 | 
				
			||||||
#include <nano/lib/stats.hpp>
 | 
					#include <nano/lib/stats.hpp>
 | 
				
			||||||
#include <nano/lib/utility.hpp>
 | 
					#include <nano/lib/utility.hpp>
 | 
				
			||||||
#include <nano/lib/work.hpp>
 | 
					#include <nano/lib/work.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/make_store.hpp>
 | 
					#include <nano/node/make_store.hpp>
 | 
				
			||||||
#include <nano/secure/common.hpp>
 | 
					#include <nano/secure/common.hpp>
 | 
				
			||||||
#include <nano/secure/ledger.hpp>
 | 
					#include <nano/secure/ledger.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
#include <nano/lib/locks.hpp>
 | 
					#include <nano/lib/locks.hpp>
 | 
				
			||||||
#include <nano/lib/numbers.hpp>
 | 
					#include <nano/lib/numbers.hpp>
 | 
				
			||||||
#include <nano/lib/work.hpp>
 | 
					#include <nano/lib/work.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <boost/asio.hpp>
 | 
					#include <boost/asio.hpp>
 | 
				
			||||||
#include <boost/asio/steady_timer.hpp>
 | 
					#include <boost/asio/steady_timer.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#include <nano/crypto_lib/random_pool.hpp>
 | 
					#include <nano/crypto_lib/random_pool.hpp>
 | 
				
			||||||
#include <nano/lib/blocks.hpp>
 | 
					#include <nano/lib/blocks.hpp>
 | 
				
			||||||
#include <nano/lib/stream.hpp>
 | 
					#include <nano/lib/stream.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/network.hpp>
 | 
					#include <nano/node/network.hpp>
 | 
				
			||||||
#include <nano/test_common/testutil.hpp>
 | 
					#include <nano/test_common/testutil.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#include <nano/lib/blocks.hpp>
 | 
					#include <nano/lib/blocks.hpp>
 | 
				
			||||||
#include <nano/lib/network_filter.hpp>
 | 
					#include <nano/lib/network_filter.hpp>
 | 
				
			||||||
#include <nano/lib/stream.hpp>
 | 
					#include <nano/lib/stream.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/secure/common.hpp>
 | 
					#include <nano/secure/common.hpp>
 | 
				
			||||||
#include <nano/test_common/testutil.hpp>
 | 
					#include <nano/test_common/testutil.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
#include <nano/lib/blocks.hpp>
 | 
					#include <nano/lib/blocks.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/local_vote_history.hpp>
 | 
					#include <nano/node/local_vote_history.hpp>
 | 
				
			||||||
#include <nano/node/vote_generator.hpp>
 | 
					#include <nano/node/vote_generator.hpp>
 | 
				
			||||||
#include <nano/node/vote_spacing.hpp>
 | 
					#include <nano/node/vote_spacing.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -59,8 +59,6 @@ add_library(
 | 
				
			||||||
  bootstrap_ascending/service.cpp
 | 
					  bootstrap_ascending/service.cpp
 | 
				
			||||||
  cli.hpp
 | 
					  cli.hpp
 | 
				
			||||||
  cli.cpp
 | 
					  cli.cpp
 | 
				
			||||||
  common.hpp
 | 
					 | 
				
			||||||
  common.cpp
 | 
					 | 
				
			||||||
  confirming_set.hpp
 | 
					  confirming_set.hpp
 | 
				
			||||||
  confirming_set.cpp
 | 
					  confirming_set.cpp
 | 
				
			||||||
  confirmation_solicitor.hpp
 | 
					  confirmation_solicitor.hpp
 | 
				
			||||||
| 
						 | 
					@ -76,6 +74,9 @@ add_library(
 | 
				
			||||||
  election_behavior.hpp
 | 
					  election_behavior.hpp
 | 
				
			||||||
  election_insertion_result.hpp
 | 
					  election_insertion_result.hpp
 | 
				
			||||||
  election_status.hpp
 | 
					  election_status.hpp
 | 
				
			||||||
 | 
					  endpoint.cpp
 | 
				
			||||||
 | 
					  endpoint.hpp
 | 
				
			||||||
 | 
					  endpoint_templ.hpp
 | 
				
			||||||
  epoch_upgrader.hpp
 | 
					  epoch_upgrader.hpp
 | 
				
			||||||
  epoch_upgrader.cpp
 | 
					  epoch_upgrader.cpp
 | 
				
			||||||
  fair_queue.hpp
 | 
					  fair_queue.hpp
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_lazy.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_lazy.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_legacy.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_legacy.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <algorithm>
 | 
					#include <algorithm>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_connections.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_connections.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <boost/multi_index/hashed_index.hpp>
 | 
					#include <boost/multi_index/hashed_index.hpp>
 | 
				
			||||||
#include <boost/multi_index/member.hpp>
 | 
					#include <boost/multi_index/member.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <future>
 | 
					#include <future>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_attempt.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_attempt.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_connections.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_connections.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_lazy.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_lazy.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <boost/format.hpp>
 | 
					#include <boost/format.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_bulk_pull.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_bulk_pull.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/transport/tcp_socket.hpp>
 | 
					#include <nano/node/transport/tcp_socket.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <atomic>
 | 
					#include <atomic>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
#include <nano/lib/blocks.hpp>
 | 
					#include <nano/lib/blocks.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_lazy.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_lazy.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
#include <nano/secure/ledger.hpp>
 | 
					#include <nano/secure/ledger.hpp>
 | 
				
			||||||
#include <nano/secure/ledger_set_any.hpp>
 | 
					#include <nano/secure/ledger_set_any.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,8 +2,8 @@
 | 
				
			||||||
#include <nano/lib/cli.hpp>
 | 
					#include <nano/lib/cli.hpp>
 | 
				
			||||||
#include <nano/lib/tomlconfig.hpp>
 | 
					#include <nano/lib/tomlconfig.hpp>
 | 
				
			||||||
#include <nano/node/cli.hpp>
 | 
					#include <nano/node/cli.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					 | 
				
			||||||
#include <nano/node/daemonconfig.hpp>
 | 
					#include <nano/node/daemonconfig.hpp>
 | 
				
			||||||
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/inactive_node.hpp>
 | 
					#include <nano/node/inactive_node.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
#include <nano/secure/ledger.hpp>
 | 
					#include <nano/secure/ledger.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@
 | 
				
			||||||
#include <nano/lib/numbers.hpp>
 | 
					#include <nano/lib/numbers.hpp>
 | 
				
			||||||
#include <nano/lib/timer.hpp>
 | 
					#include <nano/lib/timer.hpp>
 | 
				
			||||||
#include <nano/lib/work.hpp>
 | 
					#include <nano/lib/work.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <optional>
 | 
					#include <optional>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,8 +2,8 @@
 | 
				
			||||||
#include <nano/lib/memory.hpp>
 | 
					#include <nano/lib/memory.hpp>
 | 
				
			||||||
#include <nano/lib/stream.hpp>
 | 
					#include <nano/lib/stream.hpp>
 | 
				
			||||||
#include <nano/node/active_elections.hpp>
 | 
					#include <nano/node/active_elections.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					 | 
				
			||||||
#include <nano/node/election.hpp>
 | 
					#include <nano/node/election.hpp>
 | 
				
			||||||
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/network.hpp>
 | 
					#include <nano/node/network.hpp>
 | 
				
			||||||
#include <nano/node/wallet.hpp>
 | 
					#include <nano/node/wallet.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,6 +27,12 @@ uint64_t nano::ip_address_hash_raw (boost::asio::ip::address const & ip_a, uint1
 | 
				
			||||||
	return result;
 | 
						return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					uint64_t nano::endpoint_hash_raw (nano::endpoint const & endpoint_a)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						uint64_t result (nano::ip_address_hash_raw (endpoint_a.address (), endpoint_a.port ()));
 | 
				
			||||||
 | 
						return result;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool nano::parse_port (std::string const & string_a, uint16_t & port_a)
 | 
					bool nano::parse_port (std::string const & string_a, uint16_t & port_a)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	bool result = false;
 | 
						bool result = false;
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,10 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/boost/asio/ip/tcp.hpp>
 | 
					 | 
				
			||||||
#include <nano/secure/common.hpp>
 | 
					#include <nano/secure/common.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <cstdint>
 | 
				
			||||||
#include <optional>
 | 
					#include <optional>
 | 
				
			||||||
 | 
					#include <string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace boost::asio::ip
 | 
					namespace boost::asio::ip
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -19,16 +20,11 @@ bool parse_endpoint (std::string const &, nano::endpoint &);
 | 
				
			||||||
std::optional<nano::endpoint> parse_endpoint (std::string const &);
 | 
					std::optional<nano::endpoint> parse_endpoint (std::string const &);
 | 
				
			||||||
bool parse_tcp_endpoint (std::string const &, nano::tcp_endpoint &);
 | 
					bool parse_tcp_endpoint (std::string const &, nano::tcp_endpoint &);
 | 
				
			||||||
uint64_t ip_address_hash_raw (boost::asio::ip::address const & ip_a, uint16_t port = 0);
 | 
					uint64_t ip_address_hash_raw (boost::asio::ip::address const & ip_a, uint16_t port = 0);
 | 
				
			||||||
 | 
					uint64_t endpoint_hash_raw (nano::endpoint const & endpoint_a);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace
 | 
					namespace
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
uint64_t endpoint_hash_raw (nano::endpoint const & endpoint_a)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	uint64_t result (nano::ip_address_hash_raw (endpoint_a.address (), endpoint_a.port ()));
 | 
					 | 
				
			||||||
	return result;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
template <std::size_t size>
 | 
					template <std::size_t size>
 | 
				
			||||||
struct endpoint_hash
 | 
					struct endpoint_hash
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -39,7 +35,7 @@ struct endpoint_hash<8>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	std::size_t operator() (nano::endpoint const & endpoint_a) const
 | 
						std::size_t operator() (nano::endpoint const & endpoint_a) const
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		return endpoint_hash_raw (endpoint_a);
 | 
							return nano::endpoint_hash_raw (endpoint_a);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,7 +44,7 @@ struct endpoint_hash<4>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	std::size_t operator() (nano::endpoint const & endpoint_a) const
 | 
						std::size_t operator() (nano::endpoint const & endpoint_a) const
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		uint64_t big (endpoint_hash_raw (endpoint_a));
 | 
							uint64_t big = nano::endpoint_hash_raw (endpoint_a);
 | 
				
			||||||
		uint32_t result (static_cast<uint32_t> (big) ^ static_cast<uint32_t> (big >> 32));
 | 
							uint32_t result (static_cast<uint32_t> (big) ^ static_cast<uint32_t> (big >> 32));
 | 
				
			||||||
		return result;
 | 
							return result;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -83,47 +79,19 @@ struct ip_address_hash<4>
 | 
				
			||||||
namespace std
 | 
					namespace std
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
template <>
 | 
					template <>
 | 
				
			||||||
struct hash<::nano::endpoint>
 | 
					struct hash<::nano::endpoint>;
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	std::size_t operator() (::nano::endpoint const & endpoint_a) const
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		endpoint_hash<sizeof (std::size_t)> ehash;
 | 
					 | 
				
			||||||
		return ehash (endpoint_a);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef BOOST_ASIO_HAS_STD_HASH
 | 
					#ifndef BOOST_ASIO_HAS_STD_HASH
 | 
				
			||||||
template <>
 | 
					template <>
 | 
				
			||||||
struct hash<boost::asio::ip::address>
 | 
					struct hash<boost::asio::ip::address>;
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	std::size_t operator() (boost::asio::ip::address const & ip_a) const
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		ip_address_hash<sizeof (std::size_t)> ihash;
 | 
					 | 
				
			||||||
		return ihash (ip_a);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace boost
 | 
					namespace boost
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
template <>
 | 
					template <>
 | 
				
			||||||
struct hash<::nano::endpoint>
 | 
					struct hash<::nano::endpoint>;
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	std::size_t operator() (::nano::endpoint const & endpoint_a) const
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		std::hash<::nano::endpoint> hash;
 | 
					 | 
				
			||||||
		return hash (endpoint_a);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
template <>
 | 
					template <>
 | 
				
			||||||
struct hash<boost::asio::ip::address>
 | 
					struct hash<boost::asio::ip::address>;
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	std::size_t operator() (boost::asio::ip::address const & ip_a) const
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		std::hash<boost::asio::ip::address> hash;
 | 
					 | 
				
			||||||
		return hash (ip_a);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										52
									
								
								nano/node/endpoint_templ.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								nano/node/endpoint_templ.hpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,52 @@
 | 
				
			||||||
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <nano/boost/asio/ip/tcp.hpp>
 | 
				
			||||||
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace std
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					template <>
 | 
				
			||||||
 | 
					struct hash<::nano::endpoint>
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						std::size_t operator() (::nano::endpoint const & endpoint_a) const
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							endpoint_hash<sizeof (std::size_t)> ehash;
 | 
				
			||||||
 | 
							return ehash (endpoint_a);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef BOOST_ASIO_HAS_STD_HASH
 | 
				
			||||||
 | 
					template <>
 | 
				
			||||||
 | 
					struct hash<boost::asio::ip::address>
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						std::size_t operator() (boost::asio::ip::address const & ip_a) const
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							ip_address_hash<sizeof (std::size_t)> ihash;
 | 
				
			||||||
 | 
							return ihash (ip_a);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace boost
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					template <>
 | 
				
			||||||
 | 
					struct hash<::nano::endpoint>
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						std::size_t operator() (::nano::endpoint const & endpoint_a) const
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							std::hash<::nano::endpoint> hash;
 | 
				
			||||||
 | 
							return hash (endpoint_a);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					template <>
 | 
				
			||||||
 | 
					struct hash<boost::asio::ip::address>
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						std::size_t operator() (boost::asio::ip::address const & ip_a) const
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							std::hash<boost::asio::ip::address> hash;
 | 
				
			||||||
 | 
							return hash (ip_a);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -8,9 +8,9 @@
 | 
				
			||||||
#include <nano/node/active_elections.hpp>
 | 
					#include <nano/node/active_elections.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap/bootstrap_lazy.hpp>
 | 
					#include <nano/node/bootstrap/bootstrap_lazy.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap_ascending/service.hpp>
 | 
					#include <nano/node/bootstrap_ascending/service.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					 | 
				
			||||||
#include <nano/node/confirming_set.hpp>
 | 
					#include <nano/node/confirming_set.hpp>
 | 
				
			||||||
#include <nano/node/election.hpp>
 | 
					#include <nano/node/election.hpp>
 | 
				
			||||||
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/json_handler.hpp>
 | 
					#include <nano/node/json_handler.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
#include <nano/node/node_rpc_config.hpp>
 | 
					#include <nano/node/node_rpc_config.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,8 +8,8 @@
 | 
				
			||||||
#include <nano/lib/stream.hpp>
 | 
					#include <nano/lib/stream.hpp>
 | 
				
			||||||
#include <nano/lib/utility.hpp>
 | 
					#include <nano/lib/utility.hpp>
 | 
				
			||||||
#include <nano/lib/work.hpp>
 | 
					#include <nano/lib/work.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					 | 
				
			||||||
#include <nano/node/election.hpp>
 | 
					#include <nano/node/election.hpp>
 | 
				
			||||||
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/messages.hpp>
 | 
					#include <nano/node/messages.hpp>
 | 
				
			||||||
#include <nano/node/network.hpp>
 | 
					#include <nano/node/network.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <nano/boost/asio/ip/tcp.hpp>
 | 
				
			||||||
#include <nano/lib/asio.hpp>
 | 
					#include <nano/lib/asio.hpp>
 | 
				
			||||||
#include <nano/lib/block_uniquer.hpp>
 | 
					#include <nano/lib/block_uniquer.hpp>
 | 
				
			||||||
#include <nano/lib/config.hpp>
 | 
					#include <nano/lib/config.hpp>
 | 
				
			||||||
| 
						 | 
					@ -11,7 +12,7 @@
 | 
				
			||||||
#include <nano/lib/object_stream.hpp>
 | 
					#include <nano/lib/object_stream.hpp>
 | 
				
			||||||
#include <nano/lib/stats_enums.hpp>
 | 
					#include <nano/lib/stats_enums.hpp>
 | 
				
			||||||
#include <nano/lib/stream_fwd.hpp>
 | 
					#include <nano/lib/stream_fwd.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/secure/common.hpp>
 | 
					#include <nano/secure/common.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <bitset>
 | 
					#include <bitset>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/lib/logging.hpp>
 | 
					#include <nano/lib/logging.hpp>
 | 
				
			||||||
#include <nano/lib/network_filter.hpp>
 | 
					#include <nano/lib/network_filter.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/messages.hpp>
 | 
					#include <nano/node/messages.hpp>
 | 
				
			||||||
#include <nano/node/peer_exclusion.hpp>
 | 
					#include <nano/node/peer_exclusion.hpp>
 | 
				
			||||||
#include <nano/node/transport/common.hpp>
 | 
					#include <nano/node/transport/common.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,10 +11,10 @@
 | 
				
			||||||
#include <nano/node/bootstrap_ascending/service.hpp>
 | 
					#include <nano/node/bootstrap_ascending/service.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap_weights_beta.hpp>
 | 
					#include <nano/node/bootstrap_weights_beta.hpp>
 | 
				
			||||||
#include <nano/node/bootstrap_weights_live.hpp>
 | 
					#include <nano/node/bootstrap_weights_live.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					 | 
				
			||||||
#include <nano/node/confirming_set.hpp>
 | 
					#include <nano/node/confirming_set.hpp>
 | 
				
			||||||
#include <nano/node/daemonconfig.hpp>
 | 
					#include <nano/node/daemonconfig.hpp>
 | 
				
			||||||
#include <nano/node/election_status.hpp>
 | 
					#include <nano/node/election_status.hpp>
 | 
				
			||||||
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/local_block_broadcaster.hpp>
 | 
					#include <nano/node/local_block_broadcaster.hpp>
 | 
				
			||||||
#include <nano/node/local_vote_history.hpp>
 | 
					#include <nano/node/local_vote_history.hpp>
 | 
				
			||||||
#include <nano/node/make_store.hpp>
 | 
					#include <nano/node/make_store.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
 | 
					#include <nano/node/endpoint_templ.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <boost/multi_index/hashed_index.hpp>
 | 
					#include <boost/multi_index/hashed_index.hpp>
 | 
				
			||||||
#include <boost/multi_index/member.hpp>
 | 
					#include <boost/multi_index/member.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/lib/locks.hpp>
 | 
					#include <nano/lib/locks.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/fwd.hpp>
 | 
					#include <nano/node/fwd.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <atomic>
 | 
					#include <atomic>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#include <nano/lib/blocks.hpp>
 | 
					#include <nano/lib/blocks.hpp>
 | 
				
			||||||
#include <nano/lib/stats.hpp>
 | 
					#include <nano/lib/stats.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					 | 
				
			||||||
#include <nano/node/election.hpp>
 | 
					#include <nano/node/election.hpp>
 | 
				
			||||||
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/local_vote_history.hpp>
 | 
					#include <nano/node/local_vote_history.hpp>
 | 
				
			||||||
#include <nano/node/network.hpp>
 | 
					#include <nano/node/network.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/lib/utility.hpp>
 | 
					#include <nano/lib/utility.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/fwd.hpp>
 | 
					#include <nano/node/fwd.hpp>
 | 
				
			||||||
#include <nano/node/messages.hpp>
 | 
					#include <nano/node/messages.hpp>
 | 
				
			||||||
#include <nano/node/nodeconfig.hpp>
 | 
					#include <nano/node/nodeconfig.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
#include <nano/node/transport/channel.hpp>
 | 
					#include <nano/node/transport/channel.hpp>
 | 
				
			||||||
#include <nano/node/transport/transport.hpp>
 | 
					#include <nano/node/transport/transport.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
#include <nano/lib/object_stream.hpp>
 | 
					#include <nano/lib/object_stream.hpp>
 | 
				
			||||||
#include <nano/lib/stats.hpp>
 | 
					#include <nano/lib/stats.hpp>
 | 
				
			||||||
#include <nano/node/bandwidth_limiter.hpp>
 | 
					#include <nano/node/bandwidth_limiter.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/messages.hpp>
 | 
					#include <nano/node/messages.hpp>
 | 
				
			||||||
#include <nano/node/transport/tcp_socket.hpp>
 | 
					#include <nano/node/transport/tcp_socket.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/lib/network_filter.hpp>
 | 
					#include <nano/lib/network_filter.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/messages.hpp>
 | 
					#include <nano/node/messages.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <memory>
 | 
					#include <memory>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/lib/random.hpp>
 | 
					#include <nano/lib/random.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/transport/channel.hpp>
 | 
					#include <nano/node/transport/channel.hpp>
 | 
				
			||||||
#include <nano/node/transport/tcp_channel.hpp>
 | 
					#include <nano/node/transport/tcp_channel.hpp>
 | 
				
			||||||
#include <nano/node/transport/transport.hpp>
 | 
					#include <nano/node/transport/transport.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/lib/async.hpp>
 | 
					#include <nano/lib/async.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/fwd.hpp>
 | 
					#include <nano/node/fwd.hpp>
 | 
				
			||||||
#include <nano/node/transport/common.hpp>
 | 
					#include <nano/node/transport/common.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/messages.hpp>
 | 
					#include <nano/node/messages.hpp>
 | 
				
			||||||
#include <nano/node/transport/fwd.hpp>
 | 
					#include <nano/node/transport/fwd.hpp>
 | 
				
			||||||
#include <nano/node/transport/tcp_socket.hpp>
 | 
					#include <nano/node/transport/tcp_socket.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
#include <nano/node/transport/transport.hpp>
 | 
					#include <nano/node/transport/transport.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
#include <nano/lib/locks.hpp>
 | 
					#include <nano/lib/locks.hpp>
 | 
				
			||||||
#include <nano/lib/stats.hpp>
 | 
					#include <nano/lib/stats.hpp>
 | 
				
			||||||
#include <nano/node/bandwidth_limiter.hpp>
 | 
					#include <nano/node/bandwidth_limiter.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/messages.hpp>
 | 
					#include <nano/node/messages.hpp>
 | 
				
			||||||
#include <nano/node/transport/tcp_socket.hpp>
 | 
					#include <nano/node/transport/tcp_socket.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/lib/numbers.hpp>
 | 
					#include <nano/lib/numbers.hpp>
 | 
				
			||||||
#include <nano/lib/work.hpp>
 | 
					#include <nano/lib/work.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/vote_with_weight_info.hpp>
 | 
					#include <nano/node/vote_with_weight_info.hpp>
 | 
				
			||||||
#include <nano/node/websocket_stream.hpp>
 | 
					#include <nano/node/websocket_stream.hpp>
 | 
				
			||||||
#include <nano/node/websocketconfig.hpp>
 | 
					#include <nano/node/websocketconfig.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
#include <nano/lib/logging.hpp>
 | 
					#include <nano/lib/logging.hpp>
 | 
				
			||||||
#include <nano/lib/memory.hpp>
 | 
					#include <nano/lib/memory.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <gtest/gtest.h>
 | 
					#include <gtest/gtest.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/test_common/system.hpp>
 | 
					#include <nano/test_common/system.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace nano
 | 
					namespace nano
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
#include <nano/lib/blocks.hpp>
 | 
					#include <nano/lib/blocks.hpp>
 | 
				
			||||||
#include <nano/lib/thread_runner.hpp>
 | 
					#include <nano/lib/thread_runner.hpp>
 | 
				
			||||||
#include <nano/node/active_elections.hpp>
 | 
					#include <nano/node/active_elections.hpp>
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/transport/tcp_listener.hpp>
 | 
					#include <nano/node/transport/tcp_listener.hpp>
 | 
				
			||||||
#include <nano/secure/ledger.hpp>
 | 
					#include <nano/secure/ledger.hpp>
 | 
				
			||||||
#include <nano/secure/ledger_set_any.hpp>
 | 
					#include <nano/secure/ledger_set_any.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
#include <nano/node/common.hpp>
 | 
					#include <nano/node/endpoint.hpp>
 | 
				
			||||||
#include <nano/node/messages.hpp>
 | 
					#include <nano/node/messages.hpp>
 | 
				
			||||||
#include <nano/node/node.hpp>
 | 
					#include <nano/node/node.hpp>
 | 
				
			||||||
#include <nano/test_common/telemetry.hpp>
 | 
					#include <nano/test_common/telemetry.hpp>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue