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

Method WriteCryptedKey

src/wallet/walletdb.cpp:300–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300bool CWalletDB::WriteCryptedKey(const CPubKey& pubkey, const std::vector<unsigned char>& vchCryptedSecret) {
301 nWalletDBUpdated++;
302 if (!Write(std::make_pair(std::string("ckey"), pubkey), vchCryptedSecret, true))
303 return false;
304 CKeyCombi keyCombi;
305 CKeyID keyId = pubkey.GetKeyId();
306 int32_t nVersion(0);
307 Read(string("minversion"), nVersion);
308 if (Read(make_pair(string("keystore"), keyId), keyCombi, nVersion)) {
309 keyCombi.PurgeMainKey();
310 if (!Write(make_pair(string("keystore"), keyId), keyCombi, true)) {
311 return false;
312 }
313 }
314 return true;
315}
316
317bool CWalletDB::WriteUnconfirmedTx(const uint256& hash, const std::shared_ptr<CBaseTx>& tx) {
318 nWalletDBUpdated++;

Callers 1

AddCryptedKeyMethod · 0.80

Calls 2

PurgeMainKeyMethod · 0.80
GetKeyIdMethod · 0.45

Tested by

no test coverage detected