-inline unsigned int ReceiveBufferSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); }
-inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); }
+inline uint64_t ReceiveBufferSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); }
+inline uint64_t SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); }
void AddOneShot(std::string strDest);
bool RecvLine(SOCKET hSocket, std::string& strLine);
CNode* FindNode(const CNetAddr& ip);
CNode* FindNode(const CService& ip);
CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL, int64_t nTimeout=0);
+bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);
void MapPort();
unsigned short GetListenPort();
bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string()));
extern std::vector<CNode*> vNodes;
extern CCriticalSection cs_vNodes;
+extern std::vector<std::string> vAddedNodes;
+extern CCriticalSection cs_vAddedNodes;
extern std::map<CInv, CDataStream> mapRelay;
extern std::deque<std::pair<int64_t, CInv> > vRelayExpiration;
extern CCriticalSection cs_mapRelay;
fGetAddr = false;
nMisbehavior = 0;
hashCheckpointKnown = 0;
- setInventoryKnown.max_size(SendBufferSize() / 1000);
+ setInventoryKnown.max_size((size_t)SendBufferSize() / 1000);
// Be shy and don't send version until we hear
if (hSocket != INVALID_SOCKET && !fInbound)
ENTER_CRITICAL_SECTION(cs_vSend);
if (nHeaderStart != -1)
AbortMessage();
- nHeaderStart = vSend.size();
+ nHeaderStart = (int32_t)vSend.size();
vSend << CMessageHeader(pszCommand, 0);
- nMessageStart = vSend.size();
+ nMessageStart = (uint32_t)vSend.size();
if (fDebug)
printf("sending: %s ", pszCommand);
}
return;
// Set the size
- uint32_t nSize = vSend.size() - nMessageStart;
+ uint32_t nSize = (uint32_t) vSend.size() - nMessageStart;
memcpy((char*)&vSend[nHeaderStart] + CMessageHeader::MESSAGE_SIZE_OFFSET, &nSize, sizeof(nSize));
// Set the checksum
{
if (nHeaderStart < 0)
return;
- int nSize = vSend.size() - nMessageStart;
+ int nSize = (int) vSend.size() - nMessageStart;
if (nSize > 0)
EndMessage();
else