class CDiskTxPos
{
public:
- unsigned int nFile;
- unsigned int nBlockPos;
- unsigned int nTxPos;
+ uint32_t nFile;
+ uint32_t nBlockPos;
+ uint32_t nTxPos;
CDiskTxPos()
{
{
public:
CTransaction* ptx;
- unsigned int n;
+ uint32_t n;
CInPoint() { SetNull(); }
CInPoint(CTransaction* ptxIn, unsigned int nIn) { ptx = ptxIn; n = nIn; }
{
public:
uint256 hash;
- unsigned int n;
+ uint32_t n;
COutPoint() { SetNull(); }
COutPoint(uint256 hashIn, unsigned int nIn) { hash = hashIn; n = nIn; }
public:
COutPoint prevout;
CScript scriptSig;
- unsigned int nSequence;
+ uint32_t nSequence;
CTxIn()
{
public:
static const int CURRENT_VERSION=1;
int nVersion;
- unsigned int nTime;
+ uint32_t nTime;
std::vector<CTxIn> vin;
std::vector<CTxOut> vout;
- unsigned int nLockTime;
+ uint32_t nLockTime;
// Denial-of-service detection:
mutable int nDoS;
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);
}
public:
uint256 hashBlock;
std::vector<uint256> vMerkleBranch;
- int nIndex;
+ int32_t nIndex;
// memory only
mutable bool fMerkleVerified;
public:
// header
static const int CURRENT_VERSION=6;
- int nVersion;
+ int32_t nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
- unsigned int nTime;
- unsigned int nBits;
- unsigned int nNonce;
+ uint32_t nTime;
+ uint32_t nBits;
+ uint32_t nNonce;
// network and disk
std::vector<CTransaction> vtx;
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);
}
const uint256* phashBlock;
CBlockIndex* pprev;
CBlockIndex* pnext;
- unsigned int nFile;
- unsigned int nBlockPos;
+ uint32_t nFile;
+ uint32_t nBlockPos;
uint256 nChainTrust; // ppcoin: trust score of block chain
- int nHeight;
+ int32_t nHeight;
int64_t nMint;
int64_t nMoneySupply;
- unsigned int nFlags; // ppcoin: block index flags
+ uint32_t nFlags; // ppcoin: block index flags
enum
{
BLOCK_PROOF_OF_STAKE = (1 << 0), // is proof-of-stake block
};
uint64_t nStakeModifier; // hash modifier for proof-of-stake
- unsigned int nStakeModifierChecksum; // checksum of index; in-memeory only
+ uint32_t nStakeModifierChecksum; // checksum of index; in-memeory only
// proof-of-stake specific fields
COutPoint prevoutStake;
- unsigned int nStakeTime;
+ uint32_t nStakeTime;
uint256 hashProofOfStake;
// block header
- int nVersion;
- uint256 hashMerkleRoot;
- unsigned int nTime;
- unsigned int nBits;
- unsigned int nNonce;
+ int32_t nVersion;
+ uint256 hashMerkleRoot;
+ uint32_t nTime;
+ uint32_t nBits;
+ uint32_t nNonce;
CBlockIndex()
{
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();