aboutsummaryrefslogtreecommitdiff
path: root/src/txdb.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-12-15 09:11:16 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-05 15:45:34 +0100
commit4f1524966a99c83db8c0c9f1ff74789253a1171e (patch)
tree9107f58fdd2c91af6c82e9b2e09a8af36c3d6ca6 /src/txdb.cpp
parent5d3064bc44e0b608a428e230f384bd3f846dedca (diff)
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().
Diffstat (limited to 'src/txdb.cpp')
-rw-r--r--src/txdb.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp
index 5096ab19a5..4467cdce70 100644
--- a/src/txdb.cpp
+++ b/src/txdb.cpp
@@ -39,7 +39,7 @@ bool CCoinsViewDB::HaveCoins(const uint256 &txid) const {
uint256 CCoinsViewDB::GetBestBlock() const {
uint256 hashBestChain;
if (!db.Read('B', hashBestChain))
- return uint256(0);
+ return uint256();
return hashBestChain;
}
@@ -56,7 +56,7 @@ bool CCoinsViewDB::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) {
CCoinsMap::iterator itOld = it++;
mapCoins.erase(itOld);
}
- if (hashBlock != uint256(0))
+ if (!hashBlock.IsNull())
BatchWriteHashBestChain(batch, hashBlock);
LogPrint("coindb", "Committing %u changed transactions (out of %u) to coin database...\n", (unsigned int)changed, (unsigned int)count);
@@ -179,7 +179,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
boost::scoped_ptr<leveldb::Iterator> pcursor(NewIterator());
CDataStream ssKeySet(SER_DISK, CLIENT_VERSION);
- ssKeySet << make_pair('b', uint256(0));
+ ssKeySet << make_pair('b', uint256());
pcursor->Seek(ssKeySet.str());
// Load mapBlockIndex