Add 'locked' key to the output of z_listunspent

This commit is contained in:
Duke
2025-05-18 16:07:47 -04:00
parent 8980fceadf
commit 1b527bc838

View File

@@ -4218,8 +4218,12 @@ UniValue z_listunspent(const UniValue& params, bool fHelp, const CPubKey& mypk)
libzcash::SaplingFullViewingKey fvk;
pwalletMain->GetSaplingIncomingViewingKey(boost::get<libzcash::SaplingPaymentAddress>(entry.address), ivk);
pwalletMain->GetSaplingFullViewingKey(ivk, fvk);
bool hasSaplingSpendingKey = pwalletMain->HaveSaplingSpendingKey(fvk);
const bool hasSaplingSpendingKey = pwalletMain->HaveSaplingSpendingKey(fvk);
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("amount", ValueFromAmount(CAmount(entry.note.value())))); // note.value() is equivalent to plaintext.value()
obj.push_back(Pair("memo", HexStr(entry.memo)));