From cc5a5e81217506ec6f9fff34056290f8f40a7396 Mon Sep 17 00:00:00 2001 From: furszy Date: Fri, 18 Nov 2022 11:38:56 -0300 Subject: [PATCH] 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. --- src/wallet/walletdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 6a8f0d2481..9d72323f46 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -482,7 +482,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, if (!ssValue.eof()) { uint256 checksum; ssValue >> checksum; - if ((checksum_valid = Hash(vchPrivKey) != checksum)) { + if (!(checksum_valid = Hash(vchPrivKey) == checksum)) { strErr = "Error reading wallet database: Encrypted key corrupt"; return false; }