Fix remaining walletdb and keystore C++20 issues

This commit is contained in:
Krystie
2026-05-10 01:21:06 -07:00
parent f5e2ce5ca9
commit e9e4a0ca82
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -93,7 +93,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
if (!SetCrypted())
return false;
for (const auto& [key, val] : mapCryptedKeys)
for (const auto& [pubKeyHash, val] : mapCryptedKeys)
{
const CPubKey &vchPubKey = val.first;
const std::vector<unsigned char> &vchCryptedSecret = val.second;
@@ -102,10 +102,10 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
return false;
if (vchSecret.size() != 32)
return false;
CKey key;
key.SetPubKey(vchPubKey);
key.SetSecret(vchSecret);
if (key.GetPubKey() == vchPubKey)
CKey decryptedKey;
decryptedKey.SetPubKey(vchPubKey);
decryptedKey.SetSecret(vchSecret);
if (decryptedKey.GetPubKey() == vchPubKey)
break;
return false;
}
+2 -2
View File
@@ -98,13 +98,13 @@ public:
bool WriteTx(uint256 hash, const CWalletTx& wtx)
{
nWalletDBUpdated++;
return Write({std::string("tx"), hash}, wtx);
return Write(std::make_pair(std::string("tx"), hash), wtx);
}
bool EraseTx(uint256 hash)
{
nWalletDBUpdated++;
return Erase({std::string("tx"), hash});
return Erase(std::make_pair(std::string("tx"), hash));
}
bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata &keyMeta)
{