Do not merge peer on keepalive
This commit is contained in:
parent
c494819135
commit
ae4e48444d
1 changed files with 5 additions and 8 deletions
|
|
@ -171,16 +171,13 @@ public:
|
||||||
|
|
||||||
void keepalive (nano::keepalive const & message) override
|
void keepalive (nano::keepalive const & message) override
|
||||||
{
|
{
|
||||||
// Check for special node port data
|
// Check for self reported peering port
|
||||||
auto peer0 (message.peers[0]);
|
auto self_report = message.peers[0];
|
||||||
if (peer0.address () == boost::asio::ip::address_v6{} && peer0.port () != 0)
|
if (self_report.address () == boost::asio::ip::address_v6{} && self_report.port () != 0)
|
||||||
{
|
{
|
||||||
// TODO: Remove this as we do not need to establish a second connection to the same peer
|
|
||||||
nano::endpoint new_endpoint (channel->get_remote_endpoint ().address (), peer0.port ());
|
|
||||||
node.network.merge_peer (new_endpoint);
|
|
||||||
|
|
||||||
// Remember this for future forwarding to other peers
|
// Remember this for future forwarding to other peers
|
||||||
channel->set_peering_endpoint (new_endpoint);
|
nano::endpoint peering_endpoint{ channel->get_remote_endpoint ().address (), self_report.port () };
|
||||||
|
channel->set_peering_endpoint (peering_endpoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue