| 119 | } |
| 120 | |
| 121 | bool CWallet::AddCryptedKey(const CPubKey &vchPubKey, |
| 122 | const vector<unsigned char> &vchCryptedSecret) |
| 123 | { |
| 124 | if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret)) |
| 125 | return false; |
| 126 | if (!fFileBacked) |
| 127 | return true; |
| 128 | { |
| 129 | LOCK(cs_wallet); |
| 130 | if (pwalletdbEncryption) |
| 131 | return pwalletdbEncryption->WriteCryptedKey(vchPubKey, |
| 132 | vchCryptedSecret, |
| 133 | mapKeyMetadata[vchPubKey.GetID()]); |
| 134 | else |
| 135 | return CWalletDB(strWalletFile).WriteCryptedKey(vchPubKey, |
| 136 | vchCryptedSecret, |
| 137 | mapKeyMetadata[vchPubKey.GetID()]); |
| 138 | } |
| 139 | return false; |
| 140 | } |
| 141 | |
| 142 | bool CWallet::LoadKeyMetadata(const CPubKey &pubkey, const CKeyMetadata &meta) |
| 143 | { |
nothing calls this directly
no test coverage detected