| 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 |
no test coverage detected