Rename *ViewingKey* -> *SproutViewingKey*

This commit is contained in:
Jack Grigg
2018-08-03 02:16:42 +01:00
parent 74f5b010df
commit 4c77517772
10 changed files with 78 additions and 73 deletions

View File

@@ -763,14 +763,14 @@ UniValue z_importviewingkey(const UniValue& params, bool fHelp)
}
// Don't throw error in case a viewing key is already there
if (pwalletMain->HaveViewingKey(addr)) {
if (pwalletMain->HaveSproutViewingKey(addr)) {
if (fIgnoreExistingKey) {
return NullUniValue;
}
} else {
pwalletMain->MarkDirty();
if (!pwalletMain->AddViewingKey(vkey)) {
if (!pwalletMain->AddSproutViewingKey(vkey)) {
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding viewing key to wallet");
}
}
@@ -889,7 +889,7 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp)
auto addr = boost::get<libzcash::SproutPaymentAddress>(address);
libzcash::SproutViewingKey vk;
if (!pwalletMain->GetViewingKey(addr, vk)) {
if (!pwalletMain->GetSproutViewingKey(addr, vk)) {
libzcash::SproutSpendingKey k;
if (!pwalletMain->GetSpendingKey(addr, k)) {
throw JSONRPCError(RPC_WALLET_ERROR, "Wallet does not hold private key or viewing key for this zaddr");