From cdbbbb53164cf4a057e7efa8de93774618a54734 Mon Sep 17 00:00:00 2001 From: Krystie Date: Sat, 9 May 2026 20:35:59 -0700 Subject: [PATCH] Fix wallet and bigint C++20 build regressions --- src/main.cpp | 2 +- src/wallet.h | 4 ++-- src/walletdb.h | 28 ++++++++++++++-------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b1c9f06..9d59219 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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")) diff --git a/src/wallet.h b/src/wallet.h index 05db5f3..3a58036 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -100,8 +100,8 @@ public: CWallet() { - nWalletVersion = WalletFeature::Base; - nWalletMaxVersion = WalletFeature::Base; + nWalletVersion = static_cast(WalletFeature::Base); + nWalletMaxVersion = static_cast(WalletFeature::Base); fFileBacked = false; nMasterKeyMaxID = 0; pwalletdbEncryption = nullptr; diff --git a/src/walletdb.h b/src/walletdb.h index 1650473..5e49499 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -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& 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 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 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)