Replace direct use of 0 with SetNull and IsNull
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
This commit is contained in:
@@ -579,7 +579,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
|
||||
wtx.nOrderPos = IncOrderPosNext();
|
||||
|
||||
wtx.nTimeSmart = wtx.nTimeReceived;
|
||||
if (wtxIn.hashBlock != 0)
|
||||
if (!wtxIn.hashBlock.IsNull())
|
||||
{
|
||||
if (mapBlockIndex.count(wtxIn.hashBlock))
|
||||
{
|
||||
@@ -630,7 +630,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
|
||||
if (!fInsertedNew)
|
||||
{
|
||||
// Merge
|
||||
if (wtxIn.hashBlock != 0 && wtxIn.hashBlock != wtx.hashBlock)
|
||||
if (!wtxIn.hashBlock.IsNull() && wtxIn.hashBlock != wtx.hashBlock)
|
||||
{
|
||||
wtx.hashBlock = wtxIn.hashBlock;
|
||||
fUpdated = true;
|
||||
@@ -795,7 +795,7 @@ int CWalletTx::GetRequestCount() const
|
||||
if (IsCoinBase())
|
||||
{
|
||||
// Generated block
|
||||
if (hashBlock != 0)
|
||||
if (!hashBlock.IsNull())
|
||||
{
|
||||
map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock);
|
||||
if (mi != pwallet->mapRequestCount.end())
|
||||
@@ -811,7 +811,7 @@ int CWalletTx::GetRequestCount() const
|
||||
nRequests = (*mi).second;
|
||||
|
||||
// How about the block it's in?
|
||||
if (nRequests == 0 && hashBlock != 0)
|
||||
if (nRequests == 0 && !hashBlock.IsNull())
|
||||
{
|
||||
map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock);
|
||||
if (mi != pwallet->mapRequestCount.end())
|
||||
@@ -2317,7 +2317,7 @@ int CMerkleTx::SetMerkleBranch(const CBlock& block)
|
||||
|
||||
int CMerkleTx::GetDepthInMainChainINTERNAL(const CBlockIndex* &pindexRet) const
|
||||
{
|
||||
if (hashBlock == 0 || nIndex == -1)
|
||||
if (hashBlock.IsNull() || nIndex == -1)
|
||||
return 0;
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user