From 632dac91e619130289287b14f2716192edb5570a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 07:55:17 -1100 Subject: [PATCH] Revert --- src/txdb.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index 18b9d2981..cb853331f 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -424,8 +424,7 @@ bool getAddressFromIndex(const int &type, const uint160 &hash, std::string &addr UniValue CBlockTreeDB::Snapshot(int top) { - //char chType; - int64_t total = 0; int64_t totalAddresses = 0; std::string address; + char chType; int64_t total = 0; int64_t totalAddresses = 0; std::string address; int64_t utxos = 0; int64_t ignoredAddresses; boost::scoped_ptr iter(NewIterator()); std::map addressAmounts; @@ -460,30 +459,23 @@ UniValue CBlockTreeDB::Snapshot(int top) boost::this_thread::interruption_point(); try { - /*std::vector slKey = std::vector(); + std::vector slKey = std::vector(); iter->GetKey(slKey); CDataStream ssKey(slKey, SER_DISK, CLIENT_VERSION); CAddressIndexIteratorKey indexKey; ssKey >> chType; - ssKey >> indexKey;*/ + ssKey >> indexKey; - pair keyObj; - iter->GetKey(keyObj); - char chType = keyObj.first; - CAddressIndexKey indexKey = keyObj.second; - - fprintf(stderr, "chType=%d vs. %d, %d\n", chType,DB_ADDRESSUNSPENTINDEX,DB_ADDRESSINDEX); + //fprintf(stderr, "chType=%d\n", chType); if (chType == DB_ADDRESSUNSPENTINDEX) { try { - /*std::vector slValue = std::vector(); + std::vector slValue = std::vector(); iter->GetValue(slValue); - CDataStream ssValue(slValue, SER_DISK, CLIENT_VERSION);*/ + CDataStream ssValue(slValue, SER_DISK, CLIENT_VERSION); CAmount nValue; - //ssValue >> nValue; - - iter->GetValue(nValue); + ssValue >> nValue; getAddressFromIndex(indexKey.type, indexKey.hashBytes, address);