0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

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>
This commit is contained in:
Fabian Jahr 2024-03-14 22:14:44 +01:00
parent 2aff9a36c3
commit dc2938e979
No known key found for this signature in database
GPG key ID: F13D1E9D890798CD
3 changed files with 4 additions and 5 deletions

View file

@ -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
//!

View file

@ -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
};

View file

@ -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)),