From 329d80d2c1b8ecbfea30b0d78f7252bc4da94bf7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Jun 2018 00:34:28 -1100 Subject: [PATCH] Move code --- src/main.cpp | 8 ++++++++ src/rpcmisc.cpp | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2100b59ed..d15ff62c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -585,6 +585,14 @@ CBlockTreeDB *pblocktree = NULL; #define KOMODO_ZCASH #include "komodo.h" +int32_t komodo_snapshot() +{ + int32_t num = -1; + if ( pblocktree != 0 ) + num = pblocktree->Snapshot(); + return(num); +} + ////////////////////////////////////////////////////////////////////////////// // // mapOrphanTransactions diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index b348a893f..4c4d1958b 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -993,6 +993,8 @@ UniValue getaddressbalance(const UniValue& params, bool fHelp) } +int32_t komodo_snapshot(); + UniValue getsnapshot(const UniValue& params, bool fHelp) { UniValue result(UniValue::VOBJ); int32_t num; @@ -1002,11 +1004,9 @@ UniValue getsnapshot(const UniValue& params, bool fHelp) "getsnapshot\n" ); } - if ( pblocktree != 0 ) - { - num = pblocktree->Snapshot(); + if ( (num= komodo_snapshot()) >= 0 ) result.push_back(Pair("numaddresses", num)); - } else result.push_back(Pair("error", "no addressindex")); + else result.push_back(Pair("error", "no addressindex")); return(result); }