Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,000 Lines • ▼ Show 20 Lines | if (!crypter.Encrypt(_vMasterKey, kMasterKey.vchCryptedKey)) { | ||||
encrypted_batch = nullptr; | encrypted_batch = nullptr; | ||||
return false; | return false; | ||||
} | } | ||||
encrypted_batch->WriteMasterKey(nMasterKeyMaxID, kMasterKey); | encrypted_batch->WriteMasterKey(nMasterKeyMaxID, kMasterKey); | ||||
if (!EncryptKeys(_vMasterKey)) { | if (!EncryptKeys(_vMasterKey)) { | ||||
encrypted_batch->TxnAbort(); | encrypted_batch->TxnAbort(); | ||||
delete encrypted_batch; | delete encrypted_batch; | ||||
encrypted_batch = nullptr; | |||||
// We now probably have half of our keys encrypted in memory, and | // We now probably have half of our keys encrypted in memory, and | ||||
// half not... die and let the user reload the unencrypted wallet. | // half not... die and let the user reload the unencrypted wallet. | ||||
assert(false); | assert(false); | ||||
} | } | ||||
// Encryption was introduced in version 0.4.0 | // Encryption was introduced in version 0.4.0 | ||||
SetMinVersion(FEATURE_WALLETCRYPT, encrypted_batch, true); | SetMinVersion(FEATURE_WALLETCRYPT, encrypted_batch, true); | ||||
if (!encrypted_batch->TxnCommit()) { | if (!encrypted_batch->TxnCommit()) { | ||||
delete encrypted_batch; | delete encrypted_batch; | ||||
encrypted_batch = nullptr; | |||||
// We now have keys encrypted in memory, but not on disk... | // We now have keys encrypted in memory, but not on disk... | ||||
// die to avoid confusion and let the user reload the unencrypted | // die to avoid confusion and let the user reload the unencrypted | ||||
// wallet. | // wallet. | ||||
assert(false); | assert(false); | ||||
} | } | ||||
delete encrypted_batch; | delete encrypted_batch; | ||||
encrypted_batch = nullptr; | encrypted_batch = nullptr; | ||||
▲ Show 20 Lines • Show All 4,427 Lines • Show Last 20 Lines |