MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / WriteCryptedKey

Method WriteCryptedKey

src/wallet/walletdb.cpp:93–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93bool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey,
94 const std::vector<unsigned char>& vchCryptedSecret,
95 const CKeyMetadata &keyMeta)
96{
97 const bool fEraseUnencryptedKey = true;
98 nWalletDBUpdated++;
99
100 if (!Write(std::make_pair(std::string("keymeta"), vchPubKey),
101 keyMeta))
102 return false;
103
104 if (!Write(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false))
105 return false;
106 if (fEraseUnencryptedKey)
107 {
108 Erase(std::make_pair(std::string("key"), vchPubKey));
109 Erase(std::make_pair(std::string("wkey"), vchPubKey));
110 }
111 return true;
112}
113
114bool CWalletDB::WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)
115{

Callers 1

AddCryptedKeyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected