// Return the number of (unique) addresses in all tables.
int size()
{
- return vRandom.size();
+ return (int) vRandom.size();
}
// Consistency check
void SetNull()
{
nVersion = CTransaction::CURRENT_VERSION;
- nTime = GetAdjustedTime();
+ nTime = (uint32_t) GetAdjustedTime();
vin.clear();
vout.clear();
nLockTime = 0;
filein >> *this;
}
catch (std::exception &e) {
+ (void)e;
return error("%s() : deserialize or I/O error", BOOST_CURRENT_FUNCTION);
}
hashSig >>= 159; // take the first bit of the hash
if (fDebug && GetBoolArg("-printstakemodifier"))
printf(" entropybit=%" PRId64 "\n", hashSig.Get64());
- return hashSig.Get64();
+ return (unsigned int)hashSig.Get64();
}
// ppcoin: two types of block: proof-of-work or proof-of-stake
BOOST_FOREACH(const CTransaction& tx, vtx)
vMerkleTree.push_back(tx.GetHash());
int j = 0;
- for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
+ for (int nSize = (int)vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
{
for (int i = 0; i < nSize; i += 2)
{
BuildMerkleTree();
std::vector<uint256> vMerkleBranch;
int j = 0;
- for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
+ for (int nSize = (int)vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
{
int i = std::min(nIndex^1, nSize-1);
vMerkleBranch.push_back(vMerkleTree[j+i]);
filein >> *this;
}
catch (std::exception &e) {
+ (void)e;
return error("%s() : deserialize or I/O error", BOOST_CURRENT_FUNCTION);
}
bool GeneratedStakeModifier() const
{
- return (nFlags & BLOCK_STAKE_MODIFIER);
+ return (nFlags & BLOCK_STAKE_MODIFIER) != 0;
}
void SetStakeModifier(uint64_t nModifier, bool fGeneratedStakeModifier)
void clear();
void queryHashes(std::vector<uint256>& vtxid);
- unsigned long size()
+ size_t size()
{
LOCK(cs);
return mapTx.size();
if (lockRecv)
{
CDataStream& vRecv = pnode->vRecv;
- unsigned int nPos = vRecv.size();
+ uint64_t nPos = vRecv.size();
if (nPos > ReceiveBufferSize()) {
if (!pnode->fDisconnect)
-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);
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