src/wallet/wallet.cpp
/**
 * Ensure that every note in the wallet (for which we possess a spending key)
 * has a cached nullifier.
 */
Ensure that every note in the wallet (for which we possess a spending key)
has a cached nullifier.
Ensure that every note in the wallet ( for which we possess a spending key ) has a cached nullifier .
bool CWallet::UpdateNullifierNoteMap()
{
    {
        LOCK(cs_wallet);
        if (IsLocked())
            return false;
        ZCNoteDecryption dec;
        for (std::pair<const uint256, CWalletTx>& wtxItem : mapWallet) {
            for (mapSproutNoteData_t::value_type& item : wtxItem.second.mapSproutNoteData) {
                if (!item.second.nullifier) {
                    if (GetNoteDecryptor(item.second.address, dec)) {
                        auto i = item.first.js;
                        auto hSig = wtxItem.second.vJoinSplit[i].h_sig(
                            *pzelcashParams, wtxItem.second.joinSplitPubKey);
                        item.second.nullifier = GetSproutNoteNullifier(
                            wtxItem.second.vJoinSplit[i],
                            item.second.address,
                            dec,
                            hSig,
                            item.first.n);
                    }
                }
            }
            UpdateNullifierNoteMapWithTx(wtxItem.second);
        }
    }
    return true;
}
bool CWallet :: UpdateNullifierNoteMap ( ) { { LOCK ( cs_wallet ) ; if ( IsLocked ( ) ) return false ; ZCNoteDecryption dec ; for ( std :: pair < const uint256 , CWalletTx > & wtxItem : mapWallet ) { for ( mapSproutNoteData_t :: value_type & item : wtxItem . second . mapSproutNoteData ) { if ( ! item . second . nullifier ) { if ( GetNoteDecryptor ( item . second . address , dec ) ) { auto i = item . first . js ; auto hSig = wtxItem . second . vJoinSplit [ i ] . h_sig ( * pzelcashParams , wtxItem . second . joinSplitPubKey ) ; item . second . nullifier = GetSproutNoteNullifier ( wtxItem . second . vJoinSplit [ i ] , item . second . address , dec , hSig , item . first . n ) ; } } } UpdateNullifierNoteMapWithTx ( wtxItem . second ) ; } } return true ; }
Ensure that every note in the wallet (for which we possess a spending key)
 has a cached nullifier.
Ensure that every note in the wallet ( for which we possess a spending key ) has a cached nullifier .
// TODO: Sapling.  This method is only called from RPC walletpassphrase, which is currently unsupported // as RPC encryptwallet is hidden behind two flags: -developerencryptwallet -experimentalfeatures