MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / add_node

Method add_node

src/Chain/libraries/client/Client.cpp:1948–1966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1946 }
1947
1948 void Client::add_node(const string& remote_endpoint, int32_t oper_flag) {
1949
1950 try {
1951 auto endpoints = string_to_endpoint(remote_endpoint);
1952 for (auto endpoint : endpoints)
1953 {
1954 try {
1955 ulog("Adding peer ${peer} to peer database", ("peer", endpoint));
1956 my->_p2p_node->add_node(endpoint, oper_flag);
1957 }
1958 catch (const thinkyoung::net::already_connected_to_requested_peer&) {
1959 }
1960 }
1961 }
1962 catch (const fc::exception& e) {
1963 ulog("Unable to add peer ${remote_endpoint}: ${error}",
1964 ("remote_endpoint", remote_endpoint)("error", e.to_string()));
1965 }
1966 }
1967
1968 void Client::connect_to_peer(const string& remote_endpoint) {
1969

Callers 2

network_add_nodeMethod · 0.45

Calls 1

to_stringMethod · 0.45

Tested by

no test coverage detected