PIVX Core  5.6.99
P2P Digital Currency
Public Member Functions | Public Attributes | Friends | List of all members
SaplingNoteData Class Reference

#include <saplingscriptpubkeyman.h>

Public Member Functions

 SaplingNoteData ()
 
 SaplingNoteData (const libzcash::SaplingIncomingViewingKey &_ivk)
 
 SaplingNoteData (const libzcash::SaplingIncomingViewingKey &_ivk, const uint256 &n)
 
bool IsMyNote () const
 
 SERIALIZE_METHODS (SaplingNoteData, obj)
 

Public Attributes

std::list< SaplingWitnesswitnesses
 
Optional< libzcash::SaplingIncomingViewingKeyivk {nullopt}
 
Optional< CAmountamount {nullopt}
 Cached note amount. More...
 
Optional< libzcash::SaplingPaymentAddressaddress {nullopt}
 Cached shielded address It will be loaded the first time that the note is decrypted (when the tx is added to the wallet) More...
 
Optional< std::array< unsigned char, ZC_MEMO_SIZE > > memo {nullopt}
 Cached note memo (only for non-empty memo) It will be loaded the first time that the note is decrypted (when the tx is added to the wallet) More...
 
int witnessHeight {-1}
 Block height corresponding to the most current witness. More...
 
Optional< uint256nullifier
 Cached note nullifier. More...
 

Friends

bool operator== (const SaplingNoteData &a, const SaplingNoteData &b)
 
bool operator!= (const SaplingNoteData &a, const SaplingNoteData &b)
 

Detailed Description

Definition at line 43 of file saplingscriptpubkeyman.h.

Constructor & Destructor Documentation

◆ SaplingNoteData() [1/3]

SaplingNoteData::SaplingNoteData ( )
inline

Definition at line 47 of file saplingscriptpubkeyman.h.

◆ SaplingNoteData() [2/3]

SaplingNoteData::SaplingNoteData ( const libzcash::SaplingIncomingViewingKey _ivk)
inlineexplicit

Definition at line 48 of file saplingscriptpubkeyman.h.

◆ SaplingNoteData() [3/3]

SaplingNoteData::SaplingNoteData ( const libzcash::SaplingIncomingViewingKey _ivk,
const uint256 n 
)
inline

Definition at line 49 of file saplingscriptpubkeyman.h.

Member Function Documentation

◆ IsMyNote()

bool SaplingNoteData::IsMyNote ( ) const
inline

Definition at line 55 of file saplingscriptpubkeyman.h.

Here is the caller graph for this function:

◆ SERIALIZE_METHODS()

SaplingNoteData::SERIALIZE_METHODS ( SaplingNoteData  ,
obj   
)
inline

Definition at line 100 of file saplingscriptpubkeyman.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const SaplingNoteData a,
const SaplingNoteData b 
)
friend

Definition at line 124 of file saplingscriptpubkeyman.h.

◆ operator==

bool operator== ( const SaplingNoteData a,
const SaplingNoteData b 
)
friend

Definition at line 115 of file saplingscriptpubkeyman.h.

Member Data Documentation

◆ address

Optional<libzcash::SaplingPaymentAddress> SaplingNoteData::address {nullopt}

Cached shielded address It will be loaded the first time that the note is decrypted (when the tx is added to the wallet)

Definition at line 67 of file saplingscriptpubkeyman.h.

◆ amount

Optional<CAmount> SaplingNoteData::amount {nullopt}

Cached note amount.

It will be loaded the first time that the note is decrypted (when the tx is added to the wallet).

Definition at line 61 of file saplingscriptpubkeyman.h.

◆ ivk

Optional<libzcash::SaplingIncomingViewingKey> SaplingNoteData::ivk {nullopt}

Definition at line 54 of file saplingscriptpubkeyman.h.

◆ memo

Optional<std::array<unsigned char, ZC_MEMO_SIZE> > SaplingNoteData::memo {nullopt}

Cached note memo (only for non-empty memo) It will be loaded the first time that the note is decrypted (when the tx is added to the wallet)

Definition at line 73 of file saplingscriptpubkeyman.h.

◆ nullifier

Optional<uint256> SaplingNoteData::nullifier

Cached note nullifier.

May not be set if the wallet was not unlocked when this SaplingNoteData was created. If not set, we always assume that the note has not been spent.

It's okay to cache the nullifier in the wallet, because we are storing the spending key there too, which could be used to derive this. If the wallet is encrypted, this means that someone with access to the locked wallet cannot spend notes, but can connect received notes to the transactions they are spent in. This is the same security semantics as for transparent addresses.

Definition at line 98 of file saplingscriptpubkeyman.h.

◆ witnesses

std::list<SaplingWitness> SaplingNoteData::witnesses

Definition at line 52 of file saplingscriptpubkeyman.h.

◆ witnessHeight

int SaplingNoteData::witnessHeight {-1}

Block height corresponding to the most current witness.

When we first create a SaplingNoteData in SaplingScriptPubKeyMan::FindMySaplingNotes, this is set to -1 as a placeholder. The next time CWallet::BlockConnected/CWallet::BlockDisconnected is called, we can determine what height the witness cache for this note is valid for (even if no witnesses were cached), and so can set the correct value in SaplingScriptPubKeyMan::IncrementNoteWitnesses and SaplingScriptPubKeyMan::DecrementNoteWitnesses.

Definition at line 84 of file saplingscriptpubkeyman.h.


The documentation for this class was generated from the following file: