Snapshot roc

This commit is contained in:
jl777
2018-06-12 00:26:46 -11:00
parent bd14699824
commit 2200781907
3 changed files with 20 additions and 1 deletions

View File

@@ -993,6 +993,23 @@ UniValue getaddressbalance(const UniValue& params, bool fHelp)
}
UniValue getsnapshot(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ); int32_t num;
if ( fHelp || params.size() > 0 )
{
throw runtime_error(
"getsnapshot\n"
);
}
if ( pblocktree != 0 )
{
num = pblocktree->Snapshot();
result.push_back(Pair("numaddresses", num));
} else result.push_back(Pair("error", "no addressindex"));
return(result);
}
UniValue getaddresstxids(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 1)

View File

@@ -345,6 +345,7 @@ static const CRPCCommand vRPCCommands[] =
{ "addressindex", "getaddressdeltas", &getaddressdeltas, false },
{ "addressindex", "getaddresstxids", &getaddresstxids, false },
{ "addressindex", "getaddressbalance", &getaddressbalance, false },
{ "addressindex", "getsnapshot", &getsnapshot, false },
/* Utility functions */
{ "util", "createmultisig", &createmultisig, true },

View File

@@ -177,7 +177,8 @@ extern UniValue getaddressmempool(const UniValue& params, bool fHelp);
extern UniValue getaddressutxos(const UniValue& params, bool fHelp);
extern UniValue getaddressdeltas(const UniValue& params, bool fHelp);
extern UniValue getaddresstxids(const UniValue& params, bool fHelp);
extern UniValue getaddressbalance(const UniValue& params, bool fHelp);
extern UniValue getaddresstxids(const UniValue& params, bool fHelp);
extern UniValue getsnapshot(const UniValue& params, bool fHelp);
extern UniValue getpeerinfo(const UniValue& params, bool fHelp);
extern UniValue ping(const UniValue& params, bool fHelp);
extern UniValue addnode(const UniValue& params, bool fHelp);