Skip to content

Commit cc5a5e8

Browse files
committed
wallet: bugfix, invalid crypted key "checksum_valid" set
At wallet load time, we set the crypted key "checksum_valid" variable always to false. Which, on every wallet decryption call, forces the process to re-write the entire ckeys to db when it's not needed.
1 parent 256120d commit cc5a5e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/walletdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
482482
if (!ssValue.eof()) {
483483
uint256 checksum;
484484
ssValue >> checksum;
485-
if ((checksum_valid = Hash(vchPrivKey) != checksum)) {
485+
if (!(checksum_valid = Hash(vchPrivKey) == checksum)) {
486486
strErr = "Error reading wallet database: Encrypted key corrupt";
487487
return false;
488488
}

0 commit comments

Comments
 (0)