aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2024-03-18 23:28:10 +0100
committerFabian Jahr <fjahr@protonmail.com>2024-08-04 14:24:43 +0200
commitbf0efb4fc72d3c49a2c498c944e55466dfa046dc (patch)
tree907cf166e48d76d70f603e3519bfbc7c21722897 /src/node
parent72e5d1be1f4491565249d43e836ee42cfd858866 (diff)
scripted-diff: Modernize naming of nChainTx and nTxCount
-BEGIN VERIFY SCRIPT- sed -i 's/nChainTx/m_chain_tx_count/g' $(git grep -l 'nChainTx' ./src) sed -i 's/nTxCount/tx_count/g' $(git grep -l 'nTxCount' ./src) -END VERIFY SCRIPT-
Diffstat (limited to 'src/node')
-rw-r--r--src/node/blockstorage.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp
index 29b624cb12..bfb11e9fcd 100644
--- a/src/node/blockstorage.cpp
+++ b/src/node/blockstorage.cpp
@@ -410,11 +410,11 @@ bool BlockManager::LoadBlockIndex(const std::optional<uint256>& snapshot_blockha
m_snapshot_height = au_data.height;
CBlockIndex* base{LookupBlockIndex(*snapshot_blockhash)};
- // Since nChainTx (responsible for estimated progress) isn't persisted
+ // Since m_chain_tx_count (responsible for estimated progress) isn't persisted
// to disk, we must bootstrap the value for assumedvalid chainstates
// from the hardcoded assumeutxo chainparams.
- base->nChainTx = au_data.nChainTx;
- LogPrintf("[snapshot] set nChainTx=%d for %s\n", au_data.nChainTx, snapshot_blockhash->ToString());
+ base->m_chain_tx_count = au_data.m_chain_tx_count;
+ LogPrintf("[snapshot] set m_chain_tx_count=%d for %s\n", au_data.m_chain_tx_count, snapshot_blockhash->ToString());
} else {
// If this isn't called with a snapshot blockhash, make sure the cached snapshot height
// is null. This is relevant during snapshot completion, when the blockman may be loaded
@@ -449,15 +449,15 @@ bool BlockManager::LoadBlockIndex(const std::optional<uint256>& snapshot_blockha
if (m_snapshot_height && pindex->nHeight == *m_snapshot_height &&
pindex->GetBlockHash() == *snapshot_blockhash) {
// Should have been set above; don't disturb it with code below.
- Assert(pindex->nChainTx > 0);
- } else if (pindex->pprev->nChainTx > 0) {
- pindex->nChainTx = pindex->pprev->nChainTx + pindex->nTx;
+ Assert(pindex->m_chain_tx_count > 0);
+ } else if (pindex->pprev->m_chain_tx_count > 0) {
+ pindex->m_chain_tx_count = pindex->pprev->m_chain_tx_count + pindex->nTx;
} else {
- pindex->nChainTx = 0;
+ pindex->m_chain_tx_count = 0;
m_blocks_unlinked.insert(std::make_pair(pindex->pprev, pindex));
}
} else {
- pindex->nChainTx = pindex->nTx;
+ pindex->m_chain_tx_count = pindex->nTx;
}
}
if (!(pindex->nStatus & BLOCK_FAILED_MASK) && pindex->pprev && (pindex->pprev->nStatus & BLOCK_FAILED_MASK)) {