Return snapshot info as JSON

This commit is contained in:
Duke Leto
2018-07-17 18:42:30 +00:00
parent 920f960122
commit 92dc28a3c9
4 changed files with 38 additions and 29 deletions

View File

@@ -588,21 +588,20 @@ CBlockTreeDB *pblocktree = NULL;
#define KOMODO_ZCASH
#include "komodo.h"
int64_t komodo_snapshot()
UniValue komodo_snapshot()
{
fprintf(stderr,"komodo_snapshot\n");
int64_t total = -1;
UniValue result(UniValue::VOBJ);
if (fAddressIndex) {
if ( pblocktree != 0 ) {
total = pblocktree->Snapshot();
result = pblocktree->Snapshot();
} else {
fprintf(stderr,"null pblocktree start with -addressindex=true\n");
}
} else {
fprintf(stderr,"getsnapshot requires -addressindex=true\n");
}
fprintf(stderr,"total=%li\n", total);
return(total);
return(result);
}
//////////////////////////////////////////////////////////////////////////////