X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fnet.h;h=4cc82b237e5f9e678e5a29a120d322b167f817ff;hb=ca0816152d91c929b51b2f644fcb9a69797a49fa;hp=343e77a7827150fd0794c3d9bc5d9287d6f2a866;hpb=0dd710acb6ae14bb88b33a9f86c549bdbb4b6975;p=novacoin.git diff --git a/src/net.h b/src/net.h index 343e77a..4cc82b2 100644 --- a/src/net.h +++ b/src/net.h @@ -127,6 +127,7 @@ public: bool fNetworkNode; bool fSuccessfullyConnected; bool fDisconnect; + bool fHasGrant; // whether to call semOutbound.post() at disconnect protected: int nRefCount; @@ -157,14 +158,10 @@ public: CCriticalSection cs_inventory; std::multimap mapAskFor; - CNode(SOCKET hSocketIn, CAddress addrIn, bool fInboundIn=false) + CNode(SOCKET hSocketIn, CAddress addrIn, bool fInboundIn=false) : vSend(SER_NETWORK, MIN_PROTO_VERSION), vRecv(SER_NETWORK, MIN_PROTO_VERSION) { nServices = 0; hSocket = hSocketIn; - vSend.SetType(SER_NETWORK); - vRecv.SetType(SER_NETWORK); - vSend.SetVersion(209); - vRecv.SetVersion(209); nLastSend = 0; nLastRecv = 0; nLastSendEmpty = GetTime(); @@ -175,6 +172,7 @@ public: nVersion = 0; strSubVer = ""; fClient = false; // set by version message + fHasGrant = false; fInbound = fInboundIn; fNetworkNode = false; fSuccessfullyConnected = false; @@ -612,7 +610,7 @@ inline void RelayInventory(const CInv& inv) template void RelayMessage(const CInv& inv, const T& a) { - CDataStream ss(SER_NETWORK); + CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(10000); ss << a; RelayMessage(inv, ss); @@ -631,7 +629,7 @@ inline void RelayMessage<>(const CInv& inv, const CDataStream& ss) } // Save original serialized message so newer versions are preserved - mapRelay[inv] = ss; + mapRelay.insert(std::make_pair(inv, ss)); vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv)); }