Fix wallet and bigint C++20 build regressions

This commit is contained in:
Krystie
2026-05-09 20:35:59 -07:00
parent c5967e9995
commit cdbbbb5316
3 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -1692,7 +1692,7 @@ int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees)
bnSubsidy /= 365;
bnSubsidy /= COIN;
int64_t nSubsidy = bnSubsidy.getint64();
int64_t nSubsidy = bnSubsidy.getuint64();
if (fDebug && GetBoolArg("-printcreation"))
+2 -2
View File
@@ -100,8 +100,8 @@ public:
CWallet()
{
nWalletVersion = WalletFeature::Base;
nWalletMaxVersion = WalletFeature::Base;
nWalletVersion = static_cast<int>(WalletFeature::Base);
nWalletMaxVersion = static_cast<int>(WalletFeature::Base);
fFileBacked = false;
nMasterKeyMaxID = 0;
pwalletdbEncryption = nullptr;
+14 -14
View File
@@ -110,10 +110,10 @@ public:
{
nWalletDBUpdated++;
if(!Write({std::string("keymeta"), vchPubKey}, keyMeta))
if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta))
return false;
return Write({std::string("key"), vchPubKey.Raw()}, vchPrivKey, false);
return Write(std::make_pair(std::string("key"), vchPubKey.Raw()), vchPrivKey, false);
}
bool WriteCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, const CKeyMetadata &keyMeta)
@@ -121,15 +121,15 @@ public:
nWalletDBUpdated++;
bool fEraseUnencryptedKey = true;
if(!Write({std::string("keymeta"), vchPubKey}, keyMeta))
if(!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta))
return false;
if (!Write({std::string("ckey"), vchPubKey.Raw()}, vchCryptedSecret, false))
if (!Write(std::make_pair(std::string("ckey"), vchPubKey.Raw()), vchCryptedSecret, false))
return false;
if (fEraseUnencryptedKey)
{
Erase({std::string("key"), vchPubKey.Raw()});
Erase({std::string("wkey"), vchPubKey.Raw()});
Erase(std::make_pair(std::string("key"), vchPubKey.Raw()));
Erase(std::make_pair(std::string("wkey"), vchPubKey.Raw()));
}
return true;
}
@@ -137,13 +137,13 @@ public:
bool WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)
{
nWalletDBUpdated++;
return Write({std::string("mkey"), nID}, kMasterKey, true);
return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true);
}
bool WriteCScript(const uint160& hash, const CScript& redeemScript)
{
nWalletDBUpdated++;
return Write({std::string("cscript"), hash}, redeemScript, false);
return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false);
}
bool WriteBestBlock(const CBlockLocator& locator)
@@ -171,19 +171,19 @@ public:
bool ReadPool(int64_t nPool, CKeyPool& keypool)
{
return Read({std::string("pool"), nPool}, keypool);
return Read(std::make_pair(std::string("pool"), nPool), keypool);
}
bool WritePool(int64_t nPool, const CKeyPool& keypool)
{
nWalletDBUpdated++;
return Write({std::string("pool"), nPool}, keypool);
return Write(std::make_pair(std::string("pool"), nPool), keypool);
}
bool ErasePool(int64_t nPool)
{
nWalletDBUpdated++;
return Erase({std::string("pool"), nPool});
return Erase(std::make_pair(std::string("pool"), nPool));
}
// Settings are no longer stored in wallet.dat; these are
@@ -191,18 +191,18 @@ public:
template<typename T>
bool ReadSetting(const std::string& strKey, T& value)
{
return Read({std::string("setting"), strKey}, value);
return Read(std::make_pair(std::string("setting"), strKey), value);
}
template<typename T>
bool WriteSetting(const std::string& strKey, const T& value)
{
nWalletDBUpdated++;
return Write({std::string("setting"), strKey}, value);
return Write(std::make_pair(std::string("setting"), strKey), value);
}
bool EraseSetting(const std::string& strKey)
{
nWalletDBUpdated++;
return Erase({std::string("setting"), strKey});
return Erase(std::make_pair(std::string("setting"), strKey));
}
bool WriteMinVersion(int nVersion)