From 48c3fcbed30c10ef75297659012ab036bceaca30 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Jul 2018 23:48:09 -1100 Subject: [PATCH] Snapshot() reverse iterator --- src/txdb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index a0f764962..ae15d37e1 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -402,7 +402,7 @@ int64_t CBlockTreeDB::Snapshot() { char chType; int64_t total = -1; std::string address; boost::scoped_ptr pcursor(NewIterator()); - pcursor->SeekToFirst(); + pcursor->SeekToLast(); fprintf(stderr,"pcursor iterate\n"); while (pcursor->Valid()) { @@ -428,7 +428,7 @@ int64_t CBlockTreeDB::Snapshot() total = (int64_t)nValue; else total += (int64_t)nValue; //addressIndex.push_back(make_pair(indexKey, nValue)); - pcursor->Next(); + pcursor->Prev(); } catch (const std::exception& e) { return error("failed to get address index value"); }