![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
#include <saplingscriptpubkeyman.h>
Public Member Functions | |
| SaplingScriptPubKeyMan (CWallet *parent) | |
| ~SaplingScriptPubKeyMan () | |
| void | AddToSaplingSpends (const uint256 &nullifier, const uint256 &wtxid) |
| Keep track of the used nullifier. More... | |
| bool | IsSaplingSpent (const SaplingOutPoint &op) const |
| bool | IsSaplingSpent (const uint256 &nullifier) const |
| bool | BuildWitnessChain (const CBlockIndex *pTargetBlock, const Consensus::Params ¶ms, std::string &errorStr) |
| Build the old witness chain. More... | |
| void | IncrementNoteWitnesses (const CBlockIndex *pindex, const CBlock *pblock, SaplingMerkleTree &saplingTree) |
| pindex is the new tip being connected. More... | |
| void | DecrementNoteWitnesses (const CBlockIndex *pindex) |
| pindex is the old tip being disconnected. More... | |
| void | UpdateNullifierNoteMapWithTx (const CWalletTx &wtx) |
| Update mapSaplingNullifiersToNotes with the cached nullifiers in this tx. More... | |
| void | UpdateSaplingNullifierNoteMap (SaplingNoteData &nd, const SaplingOutPoint &op, const Optional< uint256 > &nullifier) |
| Update mapSaplingNullifiersToNotes, and NoteData of a specific outpoint, directly with nullifier provided by the caller. More... | |
| void | UpdateSaplingNullifierNoteMapWithTx (CWalletTx &wtx) |
| Update mapSaplingNullifiersToNotes, computing the nullifier from a cached witness if necessary. More... | |
| void | UpdateSaplingNullifierNoteMapForBlock (const CBlock *pblock) |
| Iterate over transactions in a block and update the cached Sapling nullifiers for transactions which belong to the wallet. More... | |
| bool | SetupGeneration (const CKeyID &keyID, bool force=false, bool memonly=false) |
| Set and initialize the Sapling HD chain. More... | |
| bool | IsEnabled () const |
| void | SetHDSeed (const CPubKey &key, bool force=false, bool memonly=false) |
| void | SetHDSeed (const CKeyID &keyID, bool force=false, bool memonly=false) |
| void | SetHDChain (CHDChain &chain, bool memonly) |
| const CHDChain & | GetHDChain () const |
| uint256 | getCommonOVK () |
| void | setCommonOVK (const uint256 &ovk) |
| bool | EncryptSaplingKeys (CKeyingMaterial &vMasterKeyIn) |
| void | GetConflicts (const CWalletTx &wtx, std::set< uint256 > &result) const |
| int64_t | GetKeyCreationTime (const libzcash::SaplingIncomingViewingKey &ivk) |
| KeyAddResult | AddViewingKeyToWallet (const libzcash::SaplingExtendedFullViewingKey &extfvk) const |
| KeyAddResult | AddSpendingKeyToWallet (const Consensus::Params ¶ms, const libzcash::SaplingExtendedSpendingKey &sk, int64_t nTime) |
| libzcash::SaplingPaymentAddress | GenerateNewSaplingZKey () |
| Generates new Sapling key. More... | |
| bool | AddSaplingZKey (const libzcash::SaplingExtendedSpendingKey &key) |
| Adds Sapling spending key to the store, and saves it to disk. More... | |
| bool | AddSaplingIncomingViewingKey (const libzcash::SaplingIncomingViewingKey &ivk, const libzcash::SaplingPaymentAddress &addr) |
| bool | AddCryptedSaplingSpendingKeyDB (const libzcash::SaplingExtendedFullViewingKey &extfvk, const std::vector< unsigned char > &vchCryptedSecret) |
| bool | HaveSpendingKeyForPaymentAddress (const libzcash::SaplingPaymentAddress &zaddr) const |
| Returns true if the wallet contains the spending key. More... | |
| bool | PaymentAddressBelongsToWallet (const libzcash::SaplingPaymentAddress &zaddr) const |
| Returns true if the wallet contains the spending and viewing key for the shielded address. More... | |
| bool | LoadSaplingZKey (const libzcash::SaplingExtendedSpendingKey &key) |
| Adds spending key to the store, without saving it to disk (used by LoadWallet) More... | |
| bool | LoadSaplingZKeyMetadata (const libzcash::SaplingIncomingViewingKey &ivk, const CKeyMetadata &meta) |
| Load spending key metadata (used by LoadWallet) More... | |
| bool | LoadCryptedSaplingZKey (const libzcash::SaplingExtendedFullViewingKey &extfvk, const std::vector< unsigned char > &vchCryptedSecret) |
| Adds an encrypted spending key to the store, without saving it to disk (used by LoadWallet) More... | |
| bool | LoadSaplingPaymentAddress (const libzcash::SaplingPaymentAddress &addr, const libzcash::SaplingIncomingViewingKey &ivk) |
| Adds a Sapling payment address -> incoming viewing key map entry, without saving it to disk (used by LoadWallet) More... | |
| bool | AddSaplingSpendingKey (const libzcash::SaplingExtendedSpendingKey &sk) |
| Optional< libzcash::SaplingExtendedFullViewingKey > | GetViewingKeyForPaymentAddress (const libzcash::SaplingPaymentAddress &addr) const |
| Return the full viewing key for the shielded address. More... | |
| Optional< libzcash::SaplingExtendedSpendingKey > | GetSpendingKeyForPaymentAddress (const libzcash::SaplingPaymentAddress &addr) const |
| Return the spending key for the payment address (nullopt if the wallet has no spending key for such address) More... | |
| std::pair< mapSaplingNoteData_t, SaplingIncomingViewingKeyMap > | FindMySaplingNotes (const CTransaction &tx) const |
| Finds all output notes in the given tx that have been sent to a SaplingPaymentAddress in this wallet. More... | |
| std::vector< libzcash::SaplingPaymentAddress > | FindMySaplingAddresses (const CTransaction &tx) const |
| Find all of the addresses in the given tx that have been sent to a SaplingPaymentAddress in this wallet. More... | |
| void | GetNotes (const std::vector< SaplingOutPoint > &saplingOutpoints, std::vector< SaplingNoteEntry > &saplingEntriesRet) const |
| Find notes for the outpoints. More... | |
| void | GetFilteredNotes (std::vector< SaplingNoteEntry > &saplingEntries, Optional< libzcash::SaplingPaymentAddress > &address, int minDepth=1, bool ignoreSpent=true, bool requireSpendingKey=true, bool ignoreLocked=true) const |
| Find notes in the wallet filtered by payment address, min depth and ability to spend and if the notes are locked. More... | |
| void | GetFilteredNotes (std::vector< SaplingNoteEntry > &saplingEntries, std::set< libzcash::PaymentAddress > &filterAddresses, int minDepth=1, int maxDepth=INT_MAX, bool ignoreSpent=true, bool requireSpendingKey=true, bool ignoreLocked=true) const |
| Find notes in the wallet filtered by payment addresses, min depth, max depth, if the note is spent, if a spending key is required, and if the notes are locked. More... | |
| std::map< libzcash::SaplingPaymentAddress, std::vector< SaplingNoteEntry > > | ListNotes () const |
| Optional< libzcash::SaplingPaymentAddress > | GetAddressFromInputIfPossible (const CWalletTx *wtx, int index) const |
| Return the address from where the shielded spend is taking the funds from (if possible) More... | |
| Optional< libzcash::SaplingPaymentAddress > | GetAddressFromInputIfPossible (const uint256 &txHash, int index) const |
| bool | IsSaplingNullifierFromMe (const uint256 &nullifier) const |
| Whether the nullifier is from this wallet. More... | |
| void | GetSaplingNoteWitnesses (const std::vector< SaplingOutPoint > ¬es, std::vector< Optional< SaplingWitness >> &witnesses, uint256 &final_anchor) const |
| Return all of the witnesses for the input notes. More... | |
| std::set< std::pair< libzcash::PaymentAddress, uint256 > > | GetNullifiersForAddresses (const std::set< libzcash::PaymentAddress > &addresses) const |
| bool | IsNoteSaplingChange (const std::set< std::pair< libzcash::PaymentAddress, uint256 >> &nullifierSet, const libzcash::PaymentAddress &address, const SaplingOutPoint &entry) const |
| Optional< std::pair< libzcash::SaplingNotePlaintext, libzcash::SaplingPaymentAddress > > | TryToRecoverNote (const CWalletTx &tx, const SaplingOutPoint &op) |
| Try to recover the note using the wallet's ovks (mostly used when the outpoint is a debit) More... | |
| isminetype | IsMine (const CWalletTx &wtx, const SaplingOutPoint &op) const |
| Return true if the wallet can decrypt & spend the shielded output. More... | |
| Optional< libzcash::SaplingPaymentAddress > | GetOutPointAddress (const CWalletTx &tx, const SaplingOutPoint &op) const |
| Return the shielded address of a specific outpoint of wallet transaction. More... | |
| CAmount | GetOutPointValue (const CWalletTx &tx, const SaplingOutPoint &op) const |
| Return the shielded value of a specific outpoint of wallet transaction. More... | |
| Optional< std::string > | GetOutPointMemo (const CWalletTx &tx, const SaplingOutPoint &op) const |
| Return the memo value of a specific outpoint of wallet transaction. More... | |
| CAmount | GetCredit (const CWalletTx &tx, const isminefilter &filter, const bool fUnspent=false) const |
| Return the shielded credit of the tx. More... | |
| CAmount | GetDebit (const CTransaction &tx, const isminefilter &filter) const |
| Return the shielded debit of the tx. More... | |
| CAmount | GetShieldedChange (const CWalletTx &wtx) const |
| Return the shielded change of the tx. More... | |
| bool | IsNoteSaplingChange (const SaplingOutPoint &op, libzcash::SaplingPaymentAddress address) const |
| Check whether an specific output is change or not. More... | |
| bool | UpdatedNoteData (const CWalletTx &wtxIn, CWalletTx &wtx) |
| Update note data if is needed. More... | |
| void | ClearNoteWitnessCache () |
| Clear every notesData from every wallet tx and reset the witness cache size. More... | |
Public Attributes | |
| std::map< libzcash::SaplingIncomingViewingKey, CKeyMetadata > | mapSaplingZKeyMetadata |
| int64_t | nWitnessCacheSize {0} |
| bool | nWitnessCacheNeedsUpdate {false} |
| std::map< uint256, SaplingOutPoint > | mapSaplingNullifiersToNotes |
| The reverse mapping of nullifiers to notes. More... | |
Private Types | |
| typedef std::multimap< uint256, uint256 > | TxNullifiers |
| Used to keep track of spent Notes, and detect and report conflicts (double-spends). More... | |
Private Member Functions | |
| uint256 | getCommonOVKFromSeed () const |
Private Attributes | |
| std::map< uint256, std::list< SaplingWitness > > | cachedWitnessMap |
| int | rollbackTargetHeight = -1 |
| CWallet * | wallet {nullptr} |
| CHDChain | hdChain |
| Optional< uint256 > | commonOVK |
| TxNullifiers | mapTxSaplingNullifiers |
Definition at line 147 of file saplingscriptpubkeyman.h.
|
private |
Used to keep track of spent Notes, and detect and report conflicts (double-spends).
Definition at line 435 of file saplingscriptpubkeyman.h.
|
inlineexplicit |
Definition at line 150 of file saplingscriptpubkeyman.h.
|
inline |
Definition at line 152 of file saplingscriptpubkeyman.h.
| bool SaplingScriptPubKeyMan::AddCryptedSaplingSpendingKeyDB | ( | const libzcash::SaplingExtendedFullViewingKey & | extfvk, |
| const std::vector< unsigned char > & | vchCryptedSecret | ||
| ) |
Definition at line 1292 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::AddSaplingIncomingViewingKey | ( | const libzcash::SaplingIncomingViewingKey & | ivk, |
| const libzcash::SaplingPaymentAddress & | addr | ||
| ) |
Definition at line 1253 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::AddSaplingSpendingKey | ( | const libzcash::SaplingExtendedSpendingKey & | sk | ) |
Definition at line 1223 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::AddSaplingZKey | ( | const libzcash::SaplingExtendedSpendingKey & | key | ) |
Adds Sapling spending key to the store, and saves it to disk.
Definition at line 1202 of file saplingscriptpubkeyman.cpp.
| KeyAddResult SaplingScriptPubKeyMan::AddSpendingKeyToWallet | ( | const Consensus::Params & | params, |
| const libzcash::SaplingExtendedSpendingKey & | sk, | ||
| int64_t | nTime | ||
| ) |
Definition at line 1168 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::AddToSaplingSpends | ( | const uint256 & | nullifier, |
| const uint256 & | wtxid | ||
| ) |
Keep track of the used nullifier.
Definition at line 21 of file saplingscriptpubkeyman.cpp.
| KeyAddResult SaplingScriptPubKeyMan::AddViewingKeyToWallet | ( | const libzcash::SaplingExtendedFullViewingKey & | extfvk | ) | const |
Definition at line 1156 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::BuildWitnessChain | ( | const CBlockIndex * | pTargetBlock, |
| const Consensus::Params & | params, | ||
| std::string & | errorStr | ||
| ) |
Build the old witness chain.
Definition at line 222 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::ClearNoteWitnessCache | ( | ) |
Clear every notesData from every wallet tx and reset the witness cache size.
Definition at line 1045 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::DecrementNoteWitnesses | ( | const CBlockIndex * | pindex | ) |
pindex is the old tip being disconnected.
Definition at line 467 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::EncryptSaplingKeys | ( | CKeyingMaterial & | vMasterKeyIn | ) |
Definition at line 1270 of file saplingscriptpubkeyman.cpp.
| std::vector< libzcash::SaplingPaymentAddress > SaplingScriptPubKeyMan::FindMySaplingAddresses | ( | const CTransaction & | tx | ) | const |
Find all of the addresses in the given tx that have been sent to a SaplingPaymentAddress in this wallet.
Definition at line 562 of file saplingscriptpubkeyman.cpp.
| std::pair< mapSaplingNoteData_t, SaplingIncomingViewingKeyMap > SaplingScriptPubKeyMan::FindMySaplingNotes | ( | const CTransaction & | tx | ) | const |
Finds all output notes in the given tx that have been sent to a SaplingPaymentAddress in this wallet.
Finds all output notes in the given transaction that have been sent to SaplingPaymentAddresses in this wallet.
It should never be necessary to call this method with a CWalletTx, because the result of FindMySaplingNotes (for the addresses available at the time) will already have been cached in CWalletTx.mapSaplingNoteData.
Definition at line 514 of file saplingscriptpubkeyman.cpp.
| libzcash::SaplingPaymentAddress SaplingScriptPubKeyMan::GenerateNewSaplingZKey | ( | ) |
Generates new Sapling key.
Definition at line 1085 of file saplingscriptpubkeyman.cpp.
| Optional< libzcash::SaplingPaymentAddress > SaplingScriptPubKeyMan::GetAddressFromInputIfPossible | ( | const CWalletTx * | wtx, |
| int | index | ||
| ) | const |
Return the address from where the shielded spend is taking the funds from (if possible)
Definition at line 728 of file saplingscriptpubkeyman.cpp.
| Optional< libzcash::SaplingPaymentAddress > SaplingScriptPubKeyMan::GetAddressFromInputIfPossible | ( | const uint256 & | txHash, |
| int | index | ||
| ) | const |
Definition at line 720 of file saplingscriptpubkeyman.cpp.
| uint256 SaplingScriptPubKeyMan::getCommonOVK | ( | ) |
Definition at line 1412 of file saplingscriptpubkeyman.cpp.
|
private |
Definition at line 1434 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::GetConflicts | ( | const CWalletTx & | wtx, |
| std::set< uint256 > & | result | ||
| ) | const |
Definition at line 1137 of file saplingscriptpubkeyman.cpp.
| CAmount SaplingScriptPubKeyMan::GetCredit | ( | const CWalletTx & | tx, |
| const isminefilter & | filter, | ||
| const bool | fUnspent = false |
||
| ) | const |
Return the shielded credit of the tx.
Definition at line 870 of file saplingscriptpubkeyman.cpp.
| CAmount SaplingScriptPubKeyMan::GetDebit | ( | const CTransaction & | tx, |
| const isminefilter & | filter | ||
| ) | const |
Return the shielded debit of the tx.
Definition at line 905 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::GetFilteredNotes | ( | std::vector< SaplingNoteEntry > & | saplingEntries, |
| Optional< libzcash::SaplingPaymentAddress > & | address, | ||
| int | minDepth = 1, |
||
| bool | ignoreSpent = true, |
||
| bool | requireSpendingKey = true, |
||
| bool | ignoreLocked = true |
||
| ) | const |
Find notes in the wallet filtered by payment address, min depth and ability to spend and if the notes are locked.
These notes are decrypted and added to the output parameter vector, saplingEntries.
Definition at line 618 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::GetFilteredNotes | ( | std::vector< SaplingNoteEntry > & | saplingEntries, |
| std::set< libzcash::PaymentAddress > & | filterAddresses, | ||
| int | minDepth = 1, |
||
| int | maxDepth = INT_MAX, |
||
| bool | ignoreSpent = true, |
||
| bool | requireSpendingKey = true, |
||
| bool | ignoreLocked = true |
||
| ) | const |
Find notes in the wallet filtered by payment addresses, min depth, max depth, if the note is spent, if a spending key is required, and if the notes are locked.
These notes are decrypted and added to the output parameter vector, saplingEntries.
Definition at line 640 of file saplingscriptpubkeyman.cpp.
|
inline |
Definition at line 216 of file saplingscriptpubkeyman.h.
| int64_t SaplingScriptPubKeyMan::GetKeyCreationTime | ( | const libzcash::SaplingIncomingViewingKey & | ivk | ) |
Definition at line 1131 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::GetNotes | ( | const std::vector< SaplingOutPoint > & | saplingOutpoints, |
| std::vector< SaplingNoteEntry > & | saplingEntriesRet | ||
| ) | const |
Find notes for the outpoints.
Definition at line 585 of file saplingscriptpubkeyman.cpp.
| std::set< std::pair< libzcash::PaymentAddress, uint256 > > SaplingScriptPubKeyMan::GetNullifiersForAddresses | ( | const std::set< libzcash::PaymentAddress > & | addresses | ) | const |
Definition at line 748 of file saplingscriptpubkeyman.cpp.
| Optional< libzcash::SaplingPaymentAddress > SaplingScriptPubKeyMan::GetOutPointAddress | ( | const CWalletTx & | tx, |
| const SaplingOutPoint & | op | ||
| ) | const |
Return the shielded address of a specific outpoint of wallet transaction.
Definition at line 783 of file saplingscriptpubkeyman.cpp.
| Optional< std::string > SaplingScriptPubKeyMan::GetOutPointMemo | ( | const CWalletTx & | tx, |
| const SaplingOutPoint & | op | ||
| ) | const |
Return the memo value of a specific outpoint of wallet transaction.
Definition at line 801 of file saplingscriptpubkeyman.cpp.
| CAmount SaplingScriptPubKeyMan::GetOutPointValue | ( | const CWalletTx & | tx, |
| const SaplingOutPoint & | op | ||
| ) | const |
Return the shielded value of a specific outpoint of wallet transaction.
Definition at line 792 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::GetSaplingNoteWitnesses | ( | const std::vector< SaplingOutPoint > & | notes, |
| std::vector< Optional< SaplingWitness >> & | witnesses, | ||
| uint256 & | final_anchor | ||
| ) | const |
Return all of the witnesses for the input notes.
Definition at line 993 of file saplingscriptpubkeyman.cpp.
Return the shielded change of the tx.
Definition at line 941 of file saplingscriptpubkeyman.cpp.
| Optional< libzcash::SaplingExtendedSpendingKey > SaplingScriptPubKeyMan::GetSpendingKeyForPaymentAddress | ( | const libzcash::SaplingPaymentAddress & | addr | ) | const |
Return the spending key for the payment address (nullopt if the wallet has no spending key for such address)
Definition at line 1058 of file saplingscriptpubkeyman.cpp.
| Optional< libzcash::SaplingExtendedFullViewingKey > SaplingScriptPubKeyMan::GetViewingKeyForPaymentAddress | ( | const libzcash::SaplingPaymentAddress & | addr | ) | const |
Return the full viewing key for the shielded address.
Definition at line 1068 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::HaveSpendingKeyForPaymentAddress | ( | const libzcash::SaplingPaymentAddress & | zaddr | ) | const |
Returns true if the wallet contains the spending key.
Definition at line 1312 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::IncrementNoteWitnesses | ( | const CBlockIndex * | pindex, |
| const CBlock * | pblock, | ||
| SaplingMerkleTree & | saplingTree | ||
| ) |
pindex is the new tip being connected.
Definition at line 313 of file saplingscriptpubkeyman.cpp.
|
inline |
Definition at line 205 of file saplingscriptpubkeyman.h.
| isminetype SaplingScriptPubKeyMan::IsMine | ( | const CWalletTx & | wtx, |
| const SaplingOutPoint & | op | ||
| ) | const |
Return true if the wallet can decrypt & spend the shielded output.
Definition at line 859 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::IsNoteSaplingChange | ( | const SaplingOutPoint & | op, |
| libzcash::SaplingPaymentAddress | address | ||
| ) | const |
Check whether an specific output is change or not.
Definition at line 964 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::IsNoteSaplingChange | ( | const std::set< std::pair< libzcash::PaymentAddress, uint256 >> & | nullifierSet, |
| const libzcash::PaymentAddress & | address, | ||
| const SaplingOutPoint & | entry | ||
| ) | const |
Definition at line 972 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::IsSaplingNullifierFromMe | ( | const uint256 & | nullifier | ) | const |
Whether the nullifier is from this wallet.
Definition at line 741 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::IsSaplingSpent | ( | const SaplingOutPoint & | op | ) | const |
Definition at line 31 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::IsSaplingSpent | ( | const uint256 & | nullifier | ) | const |
Definition at line 42 of file saplingscriptpubkeyman.cpp.
| std::map< libzcash::SaplingPaymentAddress, std::vector< SaplingNoteEntry > > SaplingScriptPubKeyMan::ListNotes | ( | ) | const |
Definition at line 706 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::LoadCryptedSaplingZKey | ( | const libzcash::SaplingExtendedFullViewingKey & | extfvk, |
| const std::vector< unsigned char > & | vchCryptedSecret | ||
| ) |
Adds an encrypted spending key to the store, without saving it to disk (used by LoadWallet)
Definition at line 1334 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::LoadSaplingPaymentAddress | ( | const libzcash::SaplingPaymentAddress & | addr, |
| const libzcash::SaplingIncomingViewingKey & | ivk | ||
| ) |
Adds a Sapling payment address -> incoming viewing key map entry, without saving it to disk (used by LoadWallet)
Definition at line 1353 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::LoadSaplingZKey | ( | const libzcash::SaplingExtendedSpendingKey & | key | ) |
Adds spending key to the store, without saving it to disk (used by LoadWallet)
Definition at line 1348 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::LoadSaplingZKeyMetadata | ( | const libzcash::SaplingIncomingViewingKey & | ivk, |
| const CKeyMetadata & | meta | ||
| ) |
Load spending key metadata (used by LoadWallet)
Definition at line 1341 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::PaymentAddressBelongsToWallet | ( | const libzcash::SaplingPaymentAddress & | zaddr | ) | const |
Returns true if the wallet contains the spending and viewing key for the shielded address.
Definition at line 1322 of file saplingscriptpubkeyman.cpp.
|
inline |
Definition at line 224 of file saplingscriptpubkeyman.h.
| void SaplingScriptPubKeyMan::SetHDChain | ( | CHDChain & | chain, |
| bool | memonly | ||
| ) |
Definition at line 1396 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::SetHDSeed | ( | const CKeyID & | keyID, |
| bool | force = false, |
||
| bool | memonly = false |
||
| ) |
Definition at line 1373 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::SetHDSeed | ( | const CPubKey & | key, |
| bool | force = false, |
||
| bool | memonly = false |
||
| ) |
Definition at line 1368 of file saplingscriptpubkeyman.cpp.
| bool SaplingScriptPubKeyMan::SetupGeneration | ( | const CKeyID & | keyID, |
| bool | force = false, |
||
| bool | memonly = false |
||
| ) |
Set and initialize the Sapling HD chain.
Definition at line 1362 of file saplingscriptpubkeyman.cpp.
| Optional< std::pair< libzcash::SaplingNotePlaintext, libzcash::SaplingPaymentAddress > > SaplingScriptPubKeyMan::TryToRecoverNote | ( | const CWalletTx & | tx, |
| const SaplingOutPoint & | op | ||
| ) |
Try to recover the note using the wallet's ovks (mostly used when the outpoint is a debit)
Definition at line 819 of file saplingscriptpubkeyman.cpp.
Update note data if is needed.
Definition at line 1023 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::UpdateNullifierNoteMapWithTx | ( | const CWalletTx & | wtx | ) |
Update mapSaplingNullifiersToNotes with the cached nullifiers in this tx.
Definition at line 120 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::UpdateSaplingNullifierNoteMap | ( | SaplingNoteData & | nd, |
| const SaplingOutPoint & | op, | ||
| const Optional< uint256 > & | nullifier | ||
| ) |
Update mapSaplingNullifiersToNotes, and NoteData of a specific outpoint, directly with nullifier provided by the caller.
Definition at line 69 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::UpdateSaplingNullifierNoteMapForBlock | ( | const CBlock * | pblock | ) |
Iterate over transactions in a block and update the cached Sapling nullifiers for transactions which belong to the wallet.
Definition at line 57 of file saplingscriptpubkeyman.cpp.
| void SaplingScriptPubKeyMan::UpdateSaplingNullifierNoteMapWithTx | ( | CWalletTx & | wtx | ) |
Update mapSaplingNullifiersToNotes, computing the nullifier from a cached witness if necessary.
Definition at line 79 of file saplingscriptpubkeyman.cpp.
|
private |
Definition at line 420 of file saplingscriptpubkeyman.h.
Definition at line 427 of file saplingscriptpubkeyman.h.
|
private |
Definition at line 425 of file saplingscriptpubkeyman.h.
| std::map<uint256, SaplingOutPoint> SaplingScriptPubKeyMan::mapSaplingNullifiersToNotes |
The reverse mapping of nullifiers to notes.
The mapping cannot be updated while an encrypted wallet is locked, because we need the SpendingKey to create the nullifier (zcash#1502). This has several implications for transactions added to the wallet while locked:
Another more problematic implication is that the wallet can fail to detect transactions on the blockchain that spend our notes. There are two possible cases in which this could happen:
The wallet will only miss "pure" spends - transactions that are only linked to us by the fact that they contain notes we spent. If it also sends notes to us, or interacts with our transparent addresses, we will detect the transaction and add it to the wallet (again without caching nullifiers for new notes). As by default JoinSplits send change back to the origin PaymentAddress, the wallet should rarely miss transactions.
To work around these issues, whenever the wallet is unlocked, we scan all cached notes, and cache any missing nullifiers. Since the wallet must be unlocked in order to spend notes, this means that GetFilteredNotes will always behave correctly within that context (and any other uses will give correct responses afterwards), for the transactions that the wallet was able to detect. Any missing transactions can be rediscovered by:
Definition at line 416 of file saplingscriptpubkeyman.h.
| std::map<libzcash::SaplingIncomingViewingKey, CKeyMetadata> SaplingScriptPubKeyMan::mapSaplingZKeyMetadata |
Definition at line 357 of file saplingscriptpubkeyman.h.
|
private |
Definition at line 436 of file saplingscriptpubkeyman.h.
| bool SaplingScriptPubKeyMan::nWitnessCacheNeedsUpdate {false} |
Definition at line 365 of file saplingscriptpubkeyman.h.
| int64_t SaplingScriptPubKeyMan::nWitnessCacheSize {0} |
Definition at line 364 of file saplingscriptpubkeyman.h.
|
private |
Definition at line 421 of file saplingscriptpubkeyman.h.
|
private |
Definition at line 423 of file saplingscriptpubkeyman.h.