Merge pull request #5759 from UdjinM6/bp26532

backport: partial merge bitcoin#26532: wallet: bugfix, invalid crypted key "checksum_valid" set
This commit is contained in:
PastaPastaPasta 2023-12-11 15:43:57 -06:00 committed by GitHub
commit 985da9ab93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -395,7 +395,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: Crypted key corrupt";
return false;
}