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); }