From ad7daf7b52348e1b71aa803be10de5b2134cba11 Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Wed, 27 Sep 2017 19:47:36 +0200 Subject: Add session_t typedef + remove unused functions (#6470) * Add session_t typedef + remove unused functions u16 peer_id is used everywhere, to be more consistent and permit some evolutions on this type in the future (i'm working on a PoC), uniformize u16 peer_id to SessionId peer_id --- src/network/peerhandler.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/network/peerhandler.h') diff --git a/src/network/peerhandler.h b/src/network/peerhandler.h index b7ac9d64d..70e416e90 100644 --- a/src/network/peerhandler.h +++ b/src/network/peerhandler.h @@ -19,6 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once +#include "networkprotocol.h" + namespace con { @@ -53,21 +55,22 @@ public: virtual void deletingPeer(Peer *peer, bool timeout) = 0; }; -enum PeerChangeType +enum PeerChangeType : u8 { PEER_ADDED, PEER_REMOVED }; + struct PeerChange { - PeerChange(PeerChangeType t, u16 _peer_id, bool _timeout) + PeerChange(PeerChangeType t, session_t _peer_id, bool _timeout) : type(t), peer_id(_peer_id), timeout(_timeout) { } PeerChange() = delete; PeerChangeType type; - u16 peer_id; + session_t peer_id; bool timeout; }; } -- cgit v1.2.3