diff options
author | Fabian Jahr <fjahr@protonmail.com> | 2024-03-14 22:14:44 +0100 |
---|---|---|
committer | Fabian Jahr <fjahr@protonmail.com> | 2024-08-04 12:12:38 +0200 |
commit | dc2938e9799d79696d1db2438ef33d90542d984b (patch) | |
tree | 0503f794e8118e6bde606d919b045972130cef05 /src | |
parent | 2aff9a36c352640a263e8b5de469710f7e80eb54 (diff) |
chainparams: Change nChainTx to uint64_t
Also update types of assumeutxo chainparams and some related local variables for
consistency.
Co-authored-by: russeree <reese.russell@ymail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/chain.h | 3 | ||||
-rw-r--r-- | src/kernel/chainparams.h | 4 | ||||
-rw-r--r-- | src/validation.cpp | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/src/chain.h b/src/chain.h index e8a8c066c8..101162f07c 100644 --- a/src/chain.h +++ b/src/chain.h @@ -173,8 +173,7 @@ public: //! This value will be non-zero if this block and all previous blocks back //! to the genesis block or an assumeutxo snapshot block have reached the //! VALID_TRANSACTIONS level. - //! Change to 64-bit type before 2024 (assuming worst case of 60 byte transactions). - unsigned int nChainTx{0}; + uint64_t nChainTx{0}; //! Verification status of this block. See enum BlockStatus //! diff --git a/src/kernel/chainparams.h b/src/kernel/chainparams.h index 5d45a1fa9c..9cf7fa87f3 100644 --- a/src/kernel/chainparams.h +++ b/src/kernel/chainparams.h @@ -54,7 +54,7 @@ struct AssumeutxoData { //! //! We need to hardcode the value here because this is computed cumulatively using block data, //! which we do not necessarily have at the time of snapshot load. - unsigned int nChainTx; + uint64_t nChainTx; //! The hash of the base block for this snapshot. Used to refer to assumeutxo data //! prior to having a loaded blockindex. @@ -69,7 +69,7 @@ struct AssumeutxoData { */ struct ChainTxData { int64_t nTime; //!< UNIX timestamp of last known number of transactions - int64_t nTxCount; //!< total number of transactions between genesis and that timestamp + uint64_t nTxCount; //!< total number of transactions between genesis and that timestamp double dTxRate; //!< estimated number of transactions per second after that timestamp }; diff --git a/src/validation.cpp b/src/validation.cpp index d6b3924cda..fb0e22eaac 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2956,7 +2956,7 @@ static void UpdateTipLog( LogPrintf("%s%s: new best=%s height=%d version=0x%08x log2_work=%f tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)%s\n", prefix, func_name, tip->GetBlockHash().ToString(), tip->nHeight, tip->nVersion, - log(tip->nChainWork.getdouble()) / log(2.0), (unsigned long)tip->nChainTx, + log(tip->nChainWork.getdouble()) / log(2.0), tip->nChainTx, FormatISO8601DateTime(tip->GetBlockTime()), GuessVerificationProgress(params.TxData(), tip), coins_tip.DynamicMemoryUsage() * (1.0 / (1 << 20)), |