Skip to content

Commit

Permalink
Add CWallet::AddCryptedSaplingSpendingKey() hook
Browse files Browse the repository at this point in the history
To be filled in when we implement Sapling persistence to disk.
  • Loading branch information
str4d committed Aug 2, 2018
1 parent 9c9258c commit bc6344b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,19 @@ bool CWallet::AddCryptedSpendingKey(const libzcash::SproutPaymentAddress &addres
return false;
}

bool CWallet::AddCryptedSaplingSpendingKey(const libzcash::SaplingFullViewingKey &fvk,
const std::vector<unsigned char> &vchCryptedSecret)
{
if (!CCryptoKeyStore::AddCryptedSaplingSpendingKey(fvk, vchCryptedSecret))
return false;
if (!fFileBacked)
return true;
{
// TODO: Sapling - Write to disk
}
return false;
}

bool CWallet::LoadKeyMetadata(const CPubKey &pubkey, const CKeyMetadata &meta)
{
AssertLockHeld(cs_wallet); // mapKeyMetadata
Expand Down
4 changes: 3 additions & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -999,14 +999,16 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
bool RemoveViewingKey(const libzcash::SproutViewingKey &vk);
//! Adds a viewing key to the store, without saving it to disk (used by LoadWallet)
bool LoadViewingKey(const libzcash::SproutViewingKey &dest);

/**
* Sapling ZKeys
*/
//! Generates new Sapling key
libzcash::SaplingPaymentAddress GenerateNewSaplingZKey();
//! Adds Sapling spending key to the store, and saves it to disk
bool AddSaplingZKey(const libzcash::SaplingSpendingKey &key);
bool AddCryptedSaplingSpendingKey(const libzcash::SaplingFullViewingKey &fvk,
const std::vector<unsigned char> &vchCryptedSecret);

/**
* Increment the next transaction order id
Expand Down

0 comments on commit bc6344b

Please sign in to comment.