Skip to content

Commit dc2938e

Browse files
fjahrportlandhodl
andcommitted
chainparams: Change nChainTx to uint64_t
Also update types of assumeutxo chainparams and some related local variables for consistency. Co-authored-by: russeree <[email protected]>
1 parent 2aff9a3 commit dc2938e

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/chain.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ class CBlockIndex
173173
//! This value will be non-zero if this block and all previous blocks back
174174
//! to the genesis block or an assumeutxo snapshot block have reached the
175175
//! VALID_TRANSACTIONS level.
176-
//! Change to 64-bit type before 2024 (assuming worst case of 60 byte transactions).
177-
unsigned int nChainTx{0};
176+
uint64_t nChainTx{0};
178177

179178
//! Verification status of this block. See enum BlockStatus
180179
//!

src/kernel/chainparams.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct AssumeutxoData {
5454
//!
5555
//! We need to hardcode the value here because this is computed cumulatively using block data,
5656
//! which we do not necessarily have at the time of snapshot load.
57-
unsigned int nChainTx;
57+
uint64_t nChainTx;
5858

5959
//! The hash of the base block for this snapshot. Used to refer to assumeutxo data
6060
//! prior to having a loaded blockindex.
@@ -69,7 +69,7 @@ struct AssumeutxoData {
6969
*/
7070
struct ChainTxData {
7171
int64_t nTime; //!< UNIX timestamp of last known number of transactions
72-
int64_t nTxCount; //!< total number of transactions between genesis and that timestamp
72+
uint64_t nTxCount; //!< total number of transactions between genesis and that timestamp
7373
double dTxRate; //!< estimated number of transactions per second after that timestamp
7474
};
7575

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,7 @@ static void UpdateTipLog(
29562956
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",
29572957
prefix, func_name,
29582958
tip->GetBlockHash().ToString(), tip->nHeight, tip->nVersion,
2959-
log(tip->nChainWork.getdouble()) / log(2.0), (unsigned long)tip->nChainTx,
2959+
log(tip->nChainWork.getdouble()) / log(2.0), tip->nChainTx,
29602960
FormatISO8601DateTime(tip->GetBlockTime()),
29612961
GuessVerificationProgress(params.TxData(), tip),
29622962
coins_tip.DynamicMemoryUsage() * (1.0 / (1 << 20)),

0 commit comments

Comments
 (0)