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 pasta
parent b1e9e05c7f
commit f0feb36ce3
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -388,7 +388,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;
}