// Write block to history file
if (!CheckDiskSpace(::GetSerializeSize(*this, SER_DISK, CLIENT_VERSION)))
return error("AcceptBlock() : out of disk space");
- unsigned int nFile = -1;
+ unsigned int nFile = UINT_MAX;
unsigned int nBlockPos = 0;
if (!WriteToDisk(nFile, nBlockPos))
return error("AcceptBlock() : WriteToDisk failed");
bool GetMyExternalIP(CNetAddr& ipRet)
{
struct sockaddr_in mapped;
- uint64_t rnd = GetRand(~0LL);
+ uint64_t rnd = ULLONG_MAX;
const char *srv;
int rc = GetExternalIPbySTUN(rnd, &mapped, &srv);
if(rc >= 0) {
nLastSendEmpty = GetTime();
nTimeConnected = GetTime();
nHeaderStart = -1;
- nMessageStart = -1;
+ nMessageStart = UINT_MAX;
addr = addrIn;
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn;
nVersion = 0;
return;
vSend.resize(nHeaderStart);
nHeaderStart = -1;
- nMessageStart = -1;
+ nMessageStart = UINT_MAX;
LEAVE_CRITICAL_SECTION(cs_vSend);
if (fDebug)
}
nHeaderStart = -1;
- nMessageStart = -1;
+ nMessageStart = UINT_MAX;
LEAVE_CRITICAL_SECTION(cs_vSend);
}
memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart));
memset(pchCommand, 0, sizeof(pchCommand));
pchCommand[1] = 1;
- nMessageSize = -1;
+ nMessageSize = UINT_MAX;
nChecksum = 0;
}