| 87 | } |
| 88 | |
| 89 | void P2PProtocolBasic::on_connect() { |
| 90 | no_incoming_timer.once(float(config.p2p_no_incoming_handshake_disconnect_timeout)); |
| 91 | if (is_incoming()) |
| 92 | return; |
| 93 | p2p::Handshake::Request req; |
| 94 | req.payload_data = get_my_sync_data(); |
| 95 | req.node_data = get_my_node_data(); |
| 96 | |
| 97 | BinaryArray msg = LevinProtocol::send(req); |
| 98 | |
| 99 | send(std::move(msg)); |
| 100 | } |
| 101 | |
| 102 | void P2PProtocolBasic::on_disconnect(const std::string &ban_reason) { |
| 103 | P2PProtocol::on_disconnect(ban_reason); |