Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ bool CActiveMasternode::GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secr
// Find the vin
if (!strTxHash.empty()) {
// Let's find it
uint256 txHash(strTxHash);
uint256 txHash(uint256S(strTxHash));
int outputIndex;
try {
outputIndex = std::stoi(strOutputIndex.c_str());
Expand Down
10 changes: 5 additions & 5 deletions src/addrman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@

int CAddrInfo::GetTriedBucket(const uint256& nKey) const
{
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetLow64();
uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetHash().GetLow64();
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetCheapHash();
uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetHash().GetCheapHash();
return hash2 % ADDRMAN_TRIED_BUCKET_COUNT;
}

int CAddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src) const
{
std::vector<unsigned char> vchSourceGroupKey = src.GetGroup();
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << vchSourceGroupKey).GetHash().GetLow64();
uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP)).GetHash().GetLow64();
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << vchSourceGroupKey).GetHash().GetCheapHash();
uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP)).GetHash().GetCheapHash();
return hash2 % ADDRMAN_NEW_BUCKET_COUNT;
}

int CAddrInfo::GetBucketPosition(const uint256& nKey, bool fNew, int nBucket) const
{
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << (fNew ? 'N' : 'K') << nBucket << GetKey()).GetHash().GetLow64();
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << (fNew ? 'N' : 'K') << nBucket << GetKey()).GetHash().GetCheapHash();
return hash1 % ADDRMAN_BUCKET_SIZE;
}

Expand Down
16 changes: 8 additions & 8 deletions src/bip38.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void DecryptAES(uint256 encryptedIn, uint256 decryptionKey, uint256& output)
void ComputePreFactor(std::string strPassphrase, std::string strSalt, uint256& prefactor)
{
//passfactor is the scrypt hash of passphrase and ownersalt (NOTE this needs to handle alt cases too in the future)
uint64_t s = uint256(ReverseEndianString(strSalt)).Get64();
uint64_t s = uint256S(ReverseEndianString(strSalt)).GetCheapHash();
scrypt_hash(strPassphrase.c_str(), strPassphrase.size(), BEGIN(s), strSalt.size() / 2, BEGIN(prefactor), 16384, 8, 8, 32);
}

Expand Down Expand Up @@ -82,7 +82,7 @@ void ComputeSeedBPass(CPubKey passpoint, std::string strAddressHash, std::string
{
// Derive decryption key for seedb using scrypt with passpoint, addresshash, and ownerentropy
std::string salt = ReverseEndianString(strAddressHash + strOwnerSalt);
uint256 s2(salt);
uint256 s2(uint256S(salt));
scrypt_hash(BEGIN(passpoint), HexStr(passpoint).size() / 2, BEGIN(s2), salt.size() / 2, BEGIN(seedBPass), 1024, 1, 1, 64);
}

Expand All @@ -107,7 +107,7 @@ std::string BIP38_Encrypt(std::string strAddress, std::string strPassphrase, uin
std::string strAddressHash = AddressToBip38Hash(strAddress);

uint512 hashed;
uint64_t salt = uint256(ReverseEndianString(strAddressHash)).Get64();
uint64_t salt = uint256S(ReverseEndianString(strAddressHash)).GetCheapHash();
scrypt_hash(strPassphrase.c_str(), strPassphrase.size(), BEGIN(salt), strAddressHash.size() / 2, BEGIN(hashed), 16384, 8, 8, 64);

uint256 derivedHalf1(hashed.ToString().substr(64, 64));
Expand Down Expand Up @@ -178,11 +178,11 @@ bool BIP38_Decrypt(std::string strPassphrase, std::string strEncryptedKey, uint2
if (type == uint256(0x42)) {
uint512 hashed;
encryptedPart1 = uint256(ReverseEndianString(strKey.substr(14, 32)));
uint64_t salt = uint256(ReverseEndianString(strAddressHash)).Get64();
uint64_t salt = uint256S(ReverseEndianString(strAddressHash)).GetCheapHash();
scrypt_hash(strPassphrase.c_str(), strPassphrase.size(), BEGIN(salt), strAddressHash.size() / 2, BEGIN(hashed), 16384, 8, 8, 64);

uint256 derivedHalf1(hashed.ToString().substr(64, 64));
uint256 derivedHalf2(hashed.ToString().substr(0, 64));
uint256 derivedHalf1(uint256S(hashed.ToString().substr(64, 64)));
uint256 derivedHalf2(uint256S(hashed.ToString().substr(0, 64)));

uint256 decryptedPart1;
DecryptAES(encryptedPart1, derivedHalf2, decryptedPart1);
Expand Down Expand Up @@ -224,8 +224,8 @@ bool BIP38_Decrypt(std::string strPassphrase, std::string strEncryptedKey, uint2
ComputeSeedBPass(passpoint, strAddressHash, ownersalt, seedBPass);

//get derived halfs, being mindful for endian switch
uint256 derivedHalf1(seedBPass.ToString().substr(64, 64));
uint256 derivedHalf2(seedBPass.ToString().substr(0, 64));
uint256 derivedHalf1(uint256S(seedBPass.ToString().substr(64, 64)));
uint256 derivedHalf2(uint256S(seedBPass.ToString().substr(0, 64)));

/** Decrypt encryptedpart2 using AES256Decrypt to yield the last 8 bytes of seedb and the last 8 bytes of encryptedpart1. **/
uint256 decryptedPart2;
Expand Down
4 changes: 2 additions & 2 deletions src/chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int64_t CBlockIndex::GetMedianTimePast() const

unsigned int CBlockIndex::GetStakeEntropyBit() const
{
unsigned int nEntropyBit = ((GetBlockHash().Get64()) & 1);
unsigned int nEntropyBit = ((GetBlockHash().GetCheapHash()) & 1);
if (GetBoolArg("-printstakemodifier", false))
LogPrintf("GetStakeEntropyBit: nHeight=%u hashBlock=%s nEntropyBit=%u\n", nHeight, GetBlockHash().ToString().c_str(), nEntropyBit);

Expand Down Expand Up @@ -214,7 +214,7 @@ uint64_t CBlockIndex::GetStakeModifierV1() const
uint256 CBlockIndex::GetStakeModifierV2() const
{
if (vStakeModifier.empty() || !Params().GetConsensus().IsStakeModifierV2(nHeight))
return uint256(0);
return UINT256_ZERO;
uint256 nStakeModifier;
std::memcpy(nStakeModifier.begin(), vStakeModifier.data(), vStakeModifier.size());
return nStakeModifier;
Expand Down
6 changes: 3 additions & 3 deletions src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ class CDiskBlockIndex : public CBlockIndex

CDiskBlockIndex()
{
hashPrev = uint256();
hashPrev = UINT256_ZERO;
}

explicit CDiskBlockIndex(const CBlockIndex* pindex) : CBlockIndex(*pindex)
{
hashPrev = (pprev ? pprev->GetBlockHash() : uint256(0));
hashPrev = (pprev ? pprev->GetBlockHash() : UINT256_ZERO);
}

ADD_SERIALIZE_METHODS;
Expand Down Expand Up @@ -351,7 +351,7 @@ class CDiskBlockIndex : public CBlockIndex
READWRITE(nStakeModifier);
this->SetStakeModifier(nStakeModifier, this->GeneratedStakeModifier());
} else {
uint256 nStakeModifierV2 = 0;
uint256 nStakeModifierV2;
READWRITE(nStakeModifierV2);
this->SetStakeModifier(nStakeModifierV2);
}
Expand Down
84 changes: 42 additions & 42 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi

CBlock genesis;
genesis.vtx.push_back(txNew);
genesis.hashPrevBlock = 0;
genesis.hashPrevBlock.SetNull();
genesis.nVersion = nVersion;
genesis.nTime = nTime;
genesis.nBits = nBits;
Expand Down Expand Up @@ -85,26 +85,26 @@ static void convertSeed6(std::vector<CAddress>& vSeedsOut, const SeedSpec6* data
// + Contains no strange transactions
static Checkpoints::MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
(259201, uint256("1c9121bf9329a6234bfd1ea2d91515f19cd96990725265253f4b164283ade5dd"))
(424998, uint256("f31e381eedb0ed3ed65fcc98cc71f36012bee32e8efd017c4f9fb0620fd35f6b"))
(616764, uint256("29dd0bd1c59484f290896687b4ffb6a49afa5c498caf61967c69a541f8191557")) //first block to use modifierV2
(623933, uint256("c7aafa648a0f1450157dc93bd4d7448913a85b7448f803b4ab970d91fc2a7da7"))
(791150, uint256("8e76f462e4e82d1bd21cb72e1ce1567d4ddda2390f26074ffd1f5d9c270e5e50"))
(795000, uint256("4423cceeb9fd574137a18733416275a70fdf95283cc79ad976ca399aa424a443"))
(863787, uint256("5b2482eca24caf2a46bb22e0545db7b7037282733faa3a42ec20542509999a64"))
(863795, uint256("2ad866818c4866e0d555181daccc628056216c0db431f88a825e84ed4f469067"))
(863805, uint256("a755bd9a22b63c70d3db474f4b2b61a1f86c835b290a081bb3ec1ba2103eb4cb"))
(867733, uint256("03b26296bf693de5782c76843d2fb649cb66d4b05550c6a79c047ff7e1c3ae15"))
(879650, uint256("227e1d2b738b6cd83c46d1d64617934ec899d77cee34336a56e61b71acd10bb2"))
(895400, uint256("7796a0274a608fac12d400198174e50beda992c1d522e52e5b95b884bc1beac6"))//block that serial# range is enforced
(895991, uint256("d53013ed7ea5c325b9696c95e07667d6858f8ff7ee13fecfa90827bf3c9ae316"))//network split here
(908000, uint256("202708f8c289b676fceb832a079ff6b308a28608339acbf7584de533619d014d"))
(1142400, uint256("98aff9d605bf123247f98b1e3a02567eb5799d208d78ec30fb89737b1c1f79c5"))
(1679090, uint256("f747ce055ba1b12e1f2e842bd480bc647210799359cb2e553ab292065e3419d6")) //!< First block with a "wrapped" serial spend
(1686229, uint256("bb42bf1e886a7c23474634c90893dd3d68a6ccbfea4ac92a98da5cad0c6a6cb7")) //!< Last block in the "wrapped" serial attack range
(1778954, uint256("0d3241268264a2908d6babf00d9cd1ffb83d93d7bb4e428820127fe227c2029c")) //!< Network split here
(1788528, uint256("ea9243ff8fc079fdd7a04f11fac415de4d98e1bb0dc38db6f79f8f8bbfdbe496")) //!< Network split here
(2153200, uint256("14e477e597d24549cac5e59d97d32155e6ec2861c1003b42d0566f9bf39b65d5")); //!< First v7 block
(259201, uint256S("1c9121bf9329a6234bfd1ea2d91515f19cd96990725265253f4b164283ade5dd"))
(424998, uint256S("f31e381eedb0ed3ed65fcc98cc71f36012bee32e8efd017c4f9fb0620fd35f6b"))
(616764, uint256S("29dd0bd1c59484f290896687b4ffb6a49afa5c498caf61967c69a541f8191557")) //first block to use modifierV2
(623933, uint256S("c7aafa648a0f1450157dc93bd4d7448913a85b7448f803b4ab970d91fc2a7da7"))
(791150, uint256S("8e76f462e4e82d1bd21cb72e1ce1567d4ddda2390f26074ffd1f5d9c270e5e50"))
(795000, uint256S("4423cceeb9fd574137a18733416275a70fdf95283cc79ad976ca399aa424a443"))
(863787, uint256S("5b2482eca24caf2a46bb22e0545db7b7037282733faa3a42ec20542509999a64"))
(863795, uint256S("2ad866818c4866e0d555181daccc628056216c0db431f88a825e84ed4f469067"))
(863805, uint256S("a755bd9a22b63c70d3db474f4b2b61a1f86c835b290a081bb3ec1ba2103eb4cb"))
(867733, uint256S("03b26296bf693de5782c76843d2fb649cb66d4b05550c6a79c047ff7e1c3ae15"))
(879650, uint256S("227e1d2b738b6cd83c46d1d64617934ec899d77cee34336a56e61b71acd10bb2"))
(895400, uint256S("7796a0274a608fac12d400198174e50beda992c1d522e52e5b95b884bc1beac6"))//block that serial# range is enforced
(895991, uint256S("d53013ed7ea5c325b9696c95e07667d6858f8ff7ee13fecfa90827bf3c9ae316"))//network split here
(908000, uint256S("202708f8c289b676fceb832a079ff6b308a28608339acbf7584de533619d014d"))
(1142400, uint256S("98aff9d605bf123247f98b1e3a02567eb5799d208d78ec30fb89737b1c1f79c5"))
(1679090, uint256S("f747ce055ba1b12e1f2e842bd480bc647210799359cb2e553ab292065e3419d6")) //!< First block with a "wrapped" serial spend
(1686229, uint256S("bb42bf1e886a7c23474634c90893dd3d68a6ccbfea4ac92a98da5cad0c6a6cb7")) //!< Last block in the "wrapped" serial attack range
(1778954, uint256S("0d3241268264a2908d6babf00d9cd1ffb83d93d7bb4e428820127fe227c2029c")) //!< Network split here
(1788528, uint256S("ea9243ff8fc079fdd7a04f11fac415de4d98e1bb0dc38db6f79f8f8bbfdbe496")) //!< Network split here
(2153200, uint256S("14e477e597d24549cac5e59d97d32155e6ec2861c1003b42d0566f9bf39b65d5")); //!< First v7 block
static const Checkpoints::CCheckpointData data = {
&mapCheckpoints,
1578332625, // * UNIX timestamp of last checkpoint block
Expand All @@ -115,19 +115,19 @@ static const Checkpoints::CCheckpointData data = {

static Checkpoints::MapCheckpoints mapCheckpointsTestnet =
boost::assign::map_list_of
(0, uint256("0x001"))
(1016800, uint256("6ae7d52092fd918c8ac8d9b1334400387d3057997e6e927a88e57186dc395231"))
(1106100, uint256("c54b3e7e8b710e4075da1806adf2d508ae722627d5bcc43f594cf64d5eef8b30")) //!< zc public spend activation height
(1112700, uint256("2ad8d507dbe3d3841b9f8a29c3878d570228e9361c3e057362d7915777bbc849"))
(1347000, uint256("30c173ffc09a13f288bf6e828216107037ce5b79536b1cebd750a014f4939882")); //!< First v7 block
(0, uint256S("0x001"))
(1016800, uint256S("6ae7d52092fd918c8ac8d9b1334400387d3057997e6e927a88e57186dc395231"))
(1106100, uint256S("c54b3e7e8b710e4075da1806adf2d508ae722627d5bcc43f594cf64d5eef8b30")) //!< zc public spend activation height
(1112700, uint256S("2ad8d507dbe3d3841b9f8a29c3878d570228e9361c3e057362d7915777bbc849"))
(1347000, uint256S("30c173ffc09a13f288bf6e828216107037ce5b79536b1cebd750a014f4939882")); //!< First v7 block
static const Checkpoints::CCheckpointData dataTestnet = {
&mapCheckpointsTestnet,
1575145155,
2971390,
250};

static Checkpoints::MapCheckpoints mapCheckpointsRegtest =
boost::assign::map_list_of(0, uint256("0x001"));
boost::assign::map_list_of(0, uint256S("0x001"));
static const Checkpoints::CCheckpointData dataRegtest = {
&mapCheckpointsRegtest,
1454124731,
Expand All @@ -144,13 +144,13 @@ class CMainParams : public CChainParams

genesis = CreateGenesisBlock(1454124731, 2402015, 0x1e0ffff0, 1, 250 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818"));
assert(genesis.hashMerkleRoot == uint256("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b"));
assert(consensus.hashGenesisBlock == uint256S("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818"));
assert(genesis.hashMerkleRoot == uint256S("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b"));

consensus.fPowAllowMinDifficultyBlocks = false;
consensus.powLimit = ~uint256(0) >> 20; // PIVX starting difficulty is 1 / 2^12
consensus.posLimitV1 = ~uint256(0) >> 24;
consensus.posLimitV2 = ~uint256(0) >> 20;
consensus.powLimit = ~UINT256_ZERO >> 20; // PIVX starting difficulty is 1 / 2^12
consensus.posLimitV1 = ~UINT256_ZERO >> 24;
consensus.posLimitV2 = ~UINT256_ZERO >> 20;
consensus.nBudgetCycleBlocks = 43200; // approx. 1 every 30 days
consensus.nBudgetFeeConfirmations = 6; // Number of confirmations for the finalization fee
consensus.nCoinbaseMaturity = 100;
Expand Down Expand Up @@ -265,13 +265,13 @@ class CTestNetParams : public CMainParams

genesis = CreateGenesisBlock(1454124731, 2402015, 0x1e0ffff0, 1, 250 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818"));
assert(genesis.hashMerkleRoot == uint256("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b"));
assert(consensus.hashGenesisBlock == uint256S("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818"));
assert(genesis.hashMerkleRoot == uint256S("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b"));

consensus.fPowAllowMinDifficultyBlocks = true;
consensus.powLimit = ~uint256(0) >> 20; // PIVX starting difficulty is 1 / 2^12
consensus.posLimitV1 = ~uint256(0) >> 24;
consensus.posLimitV2 = ~uint256(0) >> 20;
consensus.powLimit = ~UINT256_ZERO >> 20; // PIVX starting difficulty is 1 / 2^12
consensus.posLimitV1 = ~UINT256_ZERO >> 24;
consensus.posLimitV2 = ~UINT256_ZERO >> 20;
consensus.nBudgetCycleBlocks = 144; // approx 10 cycles per day
consensus.nBudgetFeeConfirmations = 3; // (only 8-blocks window for finalization on testnet)
consensus.nCoinbaseMaturity = 15;
Expand Down Expand Up @@ -389,13 +389,13 @@ class CRegTestParams : public CTestNetParams

genesis = CreateGenesisBlock(1454124731, 2402015, 0x1e0ffff0, 1, 250 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818"));
assert(genesis.hashMerkleRoot == uint256("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b"));
assert(consensus.hashGenesisBlock == uint256S("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818"));
assert(genesis.hashMerkleRoot == uint256S("0x1b2ef6e2f28be914103a277377ae7729dcd125dfeb8bf97bd5964ba72b6dc39b"));

consensus.fPowAllowMinDifficultyBlocks = true;
consensus.powLimit = ~uint256(0) >> 20; // PIVX starting difficulty is 1 / 2^12
consensus.posLimitV1 = ~uint256(0) >> 24;
consensus.posLimitV2 = ~uint256(0) >> 20;
consensus.powLimit = ~UINT256_ZERO >> 20; // PIVX starting difficulty is 1 / 2^12
consensus.posLimitV1 = ~UINT256_ZERO >> 24;
consensus.posLimitV2 = ~UINT256_ZERO >> 20;
consensus.nBudgetCycleBlocks = 144; // approx 10 cycles per day
consensus.nBudgetFeeConfirmations = 3; // (only 8-blocks window for finalization on regtest)
consensus.nCoinbaseMaturity = 100;
Expand Down
8 changes: 4 additions & 4 deletions src/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ bool CCoins::Spend(const COutPoint& out, CTxInUndo& undo)
bool CCoins::Spend(int nPos)
{
CTxInUndo undo;
COutPoint out(0, nPos);
COutPoint out(UINT256_ZERO, nPos);
return Spend(out, undo);
}


bool CCoinsView::GetCoins(const uint256& txid, CCoins& coins) const { return false; }
bool CCoinsView::HaveCoins(const uint256& txid) const { return false; }
uint256 CCoinsView::GetBestBlock() const { return uint256(0); }
uint256 CCoinsView::GetBestBlock() const { return UINT256_ZERO; }
bool CCoinsView::BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock) { return false; }
bool CCoinsView::GetStats(CCoinsStats& stats) const { return false; }

Expand All @@ -76,7 +76,7 @@ bool CCoinsViewBacked::GetStats(CCoinsStats& stats) const { return base->GetStat

CCoinsKeyHasher::CCoinsKeyHasher() : salt(GetRandHash()) {}

CCoinsViewCache::CCoinsViewCache(CCoinsView* baseIn) : CCoinsViewBacked(baseIn), hasModifier(false), hashBlock(0) {}
CCoinsViewCache::CCoinsViewCache(CCoinsView* baseIn) : CCoinsViewBacked(baseIn), hasModifier(false) {}
Comment thread
random-zebra marked this conversation as resolved.

CCoinsViewCache::~CCoinsViewCache()
{
Expand Down Expand Up @@ -152,7 +152,7 @@ bool CCoinsViewCache::HaveCoins(const uint256& txid) const

uint256 CCoinsViewCache::GetBestBlock() const
{
if (hashBlock == uint256(0))
if (hashBlock.IsNull())
hashBlock = base->GetBestBlock();
return hashBlock;
}
Expand Down
2 changes: 1 addition & 1 deletion src/coins.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ struct CCoinsStats {
uint256 hashSerialized;
CAmount nTotalAmount;

CCoinsStats() : nHeight(0), hashBlock(0), nTransactions(0), nTransactionOutputs(0), nSerializedSize(0), hashSerialized(0), nTotalAmount(0) {}
CCoinsStats() : nHeight(0), nTransactions(0), nTransactionOutputs(0), nSerializedSize(0), nTotalAmount(0) {}
Comment thread
random-zebra marked this conversation as resolved.
};


Expand Down
2 changes: 1 addition & 1 deletion src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
}
entry.pushKV("vout", vout);

if (hashBlock != 0)
if (!hashBlock.IsNull())
entry.pushKV("blockhash", hashBlock.GetHex());

entry.pushKV("hex", EncodeHexTx(tx)); // the hex-encoded transaction. used the name "hex" to be consistent with the verbose output of "getrawtransaction".
Expand Down
Loading