aboutsummaryrefslogtreecommitdiff
path: root/src/txdb.cpp
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2015-10-13 20:25:57 +0200
committerDaniel Kraft <d@domob.eu>2015-10-13 20:25:57 +0200
commitf8f2aceadd5f406f8bc6f6029b032d00828e6256 (patch)
tree2268d2440e34c57c9cdf75edf1e42e651f1bab6e /src/txdb.cpp
parenta1d623da3ea4c73605d27703bc966ed8109d231e (diff)
trivial: use constants for db keys
Replace literal occurances of the key "prefixes" 'c' and 'b' in txdb.cpp by the respective constants.
Diffstat (limited to 'src/txdb.cpp')
-rw-r--r--src/txdb.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp
index 5723c92440..a441aea688 100644
--- a/src/txdb.cpp
+++ b/src/txdb.cpp
@@ -99,7 +99,7 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) const {
only need read operations on it, use a const-cast to get around
that restriction. */
boost::scoped_ptr<CLevelDBIterator> pcursor(const_cast<CLevelDBWrapper*>(&db)->NewIterator());
- pcursor->Seek('c');
+ pcursor->Seek(DB_COINS);
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
stats.hashBlock = GetBestBlock();
@@ -109,7 +109,7 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) const {
boost::this_thread::interruption_point();
std::pair<char, uint256> key;
CCoins coins;
- if (pcursor->GetKey(key) && key.first == 'c') {
+ if (pcursor->GetKey(key) && key.first == DB_COINS) {
if (pcursor->GetValue(coins)) {
stats.nTransactions++;
for (unsigned int i=0; i<coins.vout.size(); i++) {
@@ -179,13 +179,13 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
{
boost::scoped_ptr<CLevelDBIterator> pcursor(NewIterator());
- pcursor->Seek(make_pair('b', uint256()));
+ pcursor->Seek(make_pair(DB_BLOCK_INDEX, uint256()));
// Load mapBlockIndex
while (pcursor->Valid()) {
boost::this_thread::interruption_point();
std::pair<char, uint256> key;
- if (pcursor->GetKey(key) && key.first == 'b') {
+ if (pcursor->GetKey(key) && key.first == DB_BLOCK_INDEX) {
CDiskBlockIndex diskindex;
if (pcursor->GetValue(diskindex)) {
// Construct block index object