C++20 modernization: nullptr, constexpr, smart pointers, thread safety, enum class
- Replace ~320 NULL occurrences with nullptr across 47 files (-184 net lines) - static const -> constexpr for version, coin, utility constants - Collapse 9 PushMessage overloads into 1 variadic template with fold expressions - Convert boost::array -> std::array, boost::type_traits -> std:: equivalents - pwalletMain, pScriptCheckQueue, pScriptCheckThreads -> unique_ptr - mapOrphanBlocks values: raw CBlock* -> unique_ptr<CBlock> - Fix data races: add locks to wallet registration, pindexBest reads, mempool exists - pwalletdbEncryption: raw new/delete -> local unique_ptr, remove exit() calls - PoS reward overflow: CBigNum intermediate for nCoinAge * nRewardCoinYear - memset -> OPENSSL_cleanse for secure zeroing - Fix const-cast UB in SetMerkleBranch - Log silent catch(...) blocks instead of silently swallowing - Enum class: GetMinFeeMode, WalletFeature - std::string_view for 8 utility function parameters - Range-for with structured bindings: 63 iterator loops modernized - std::make_pair -> brace init: 35 sites - Delegating constructors: CWallet, CBlockIndex - Merkle tree caching, std::array for GetMedianTimePast - CScript copy ctor -> = default, operator!= -> = default
This commit is contained in:
+1
-1
@@ -126,7 +126,7 @@ extern const CRPCTable tableRPC;
|
||||
extern int64_t nWalletUnlockTime;
|
||||
extern int64_t AmountFromValue(const json_spirit::Value& value);
|
||||
extern json_spirit::Value ValueFromAmount(int64_t amount);
|
||||
extern double GetDifficulty(const CBlockIndex* blockindex = NULL);
|
||||
extern double GetDifficulty(const CBlockIndex* blockindex = nullptr);
|
||||
|
||||
extern double GetPoWMHashPS();
|
||||
extern double GetPoSKernelPS();
|
||||
|
||||
Reference in New Issue
Block a user