z_listlockunspent
This commit is contained in:
@@ -2645,6 +2645,45 @@ UniValue lockunspent(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
return true;
|
||||
}
|
||||
|
||||
UniValue z_listlockunspent(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
{
|
||||
if (!EnsureWalletIsAvailable(fHelp))
|
||||
return NullUniValue;
|
||||
|
||||
if (fHelp || params.size() > 0)
|
||||
throw runtime_error(
|
||||
"z_listlockunspent\n"
|
||||
"\nReturns list of temporarily unspendable outputs.\n"
|
||||
"\nResult:\n"
|
||||
"[\n"
|
||||
" {\n"
|
||||
" \"txid\" : \"transactionid\", (string) The transaction id locked\n"
|
||||
" \"vout\" : n (numeric) The vout value\n"
|
||||
" }\n"
|
||||
" ,...\n"
|
||||
"]\n"
|
||||
"\nExamples:\n"
|
||||
"\nList the locked Sapling notes\n"
|
||||
+ HelpExampleCli("z_listlockunspent", "") +
|
||||
"\nAs a json rpc call\n"
|
||||
+ HelpExampleRpc("z_listlockunspent", "")
|
||||
);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
vector<SaplingOutPoint> ops = pwalletMain->ListLockedSaplingNotes();
|
||||
|
||||
UniValue ret(UniValue::VARR);
|
||||
|
||||
BOOST_FOREACH(SaplingOutPoint &op, ops) {
|
||||
UniValue o(UniValue::VOBJ);
|
||||
|
||||
o.push_back(Pair("txid", op.hash.GetHex()));
|
||||
ret.push_back(o);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
UniValue listlockunspent(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
{
|
||||
if (!EnsureWalletIsAvailable(fHelp))
|
||||
|
||||
Reference in New Issue
Block a user