Add 'locked' key to the output of z_listunspent
This commit is contained in:
@@ -4218,8 +4218,12 @@ UniValue z_listunspent(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
|||||||
libzcash::SaplingFullViewingKey fvk;
|
libzcash::SaplingFullViewingKey fvk;
|
||||||
pwalletMain->GetSaplingIncomingViewingKey(boost::get<libzcash::SaplingPaymentAddress>(entry.address), ivk);
|
pwalletMain->GetSaplingIncomingViewingKey(boost::get<libzcash::SaplingPaymentAddress>(entry.address), ivk);
|
||||||
pwalletMain->GetSaplingFullViewingKey(ivk, fvk);
|
pwalletMain->GetSaplingFullViewingKey(ivk, fvk);
|
||||||
bool hasSaplingSpendingKey = pwalletMain->HaveSaplingSpendingKey(fvk);
|
const bool hasSaplingSpendingKey = pwalletMain->HaveSaplingSpendingKey(fvk);
|
||||||
obj.push_back(Pair("spendable", hasSaplingSpendingKey));
|
obj.push_back(Pair("spendable", hasSaplingSpendingKey));
|
||||||
|
|
||||||
|
const bool isLocked = pwalletMain->IsLockedNote(entry.op);
|
||||||
|
obj.push_back(Pair("locked", isLocked));
|
||||||
|
|
||||||
obj.push_back(Pair("address", EncodePaymentAddress(entry.address)));
|
obj.push_back(Pair("address", EncodePaymentAddress(entry.address)));
|
||||||
obj.push_back(Pair("amount", ValueFromAmount(CAmount(entry.note.value())))); // note.value() is equivalent to plaintext.value()
|
obj.push_back(Pair("amount", ValueFromAmount(CAmount(entry.note.value())))); // note.value() is equivalent to plaintext.value()
|
||||||
obj.push_back(Pair("memo", HexStr(entry.memo)));
|
obj.push_back(Pair("memo", HexStr(entry.memo)));
|
||||||
|
|||||||
Reference in New Issue
Block a user