src/wallet/wallet.cpp
bool CWallet::AddZKey(const libsnowgem::SpendingKey &key)
{
    AssertLockHeld(cs_wallet); // mapZKeyMetadata
    auto addr = key.address();

    if (!CCryptoKeyStore::AddSpendingKey(key))
        return false;

    if (!fFileBacked)
        return true;

    if (!IsCrypted()) {
        return CWalletDB(strWalletFile).WriteZKey(addr,
                                                  key,
                                                  mapZKeyMetadata[addr]);
    }
    return true;
}
// Add spending key to keystore and persist to disk
Add spending key to keystore and persist to disk
Add spending key to keystore and persist to disk
bool CWallet::AddZKey(const libsnowgem::SpendingKey &key)
{
    AssertLockHeld(cs_wallet); 
    auto addr = key.address();
    if (!CCryptoKeyStore::AddSpendingKey(key))
        return false;
    if (!fFileBacked)
        return true;
    if (!IsCrypted()) {
        return CWalletDB(strWalletFile).WriteZKey(addr,
                                                  key,
                                                  mapZKeyMetadata[addr]);
    }
    return true;
}
bool CWallet :: AddZKey ( const libsnowgem :: SpendingKey & key ) { AssertLockHeld ( cs_wallet ) ; auto addr = key . address ( ) ; if ( ! CCryptoKeyStore :: AddSpendingKey ( key ) ) return false ; if ( ! fFileBacked ) return true ; if ( ! IsCrypted ( ) ) { return CWalletDB ( strWalletFile ) . WriteZKey ( addr , key , mapZKeyMetadata [ addr ] ) ; } return true ; }
Add spending key to keystore and persist to disk
Add spending key to keystore and persist to disk
// mapZKeyMetadata