Browse Source

Snapshot roc

pull/4/head
jl777 6 years ago
parent
commit
2200781907
  1. 17
      src/rpcmisc.cpp
  2. 1
      src/rpcserver.cpp
  3. 3
      src/rpcserver.h

17
src/rpcmisc.cpp

@ -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)

1
src/rpcserver.cpp

@ -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 },

3
src/rpcserver.h

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

Loading…
Cancel
Save