aboutsummaryrefslogtreecommitdiff
path: root/src/node/blockstorage.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2022-04-28 11:15:38 +0200
committerJon Atack <jon@atack.com>2022-04-28 20:42:08 +0200
commit86ce844d3b287012f27c7b0bad6d11c9bdd3120e (patch)
tree4d898671471031fae127c64f8ae9dbe03ba1092b /src/node/blockstorage.cpp
parented12c0a49d3c64d170aca9e66ef32a57d7933eeb (diff)
downloadbitcoin-86ce844d3b287012f27c7b0bad6d11c9bdd3120e.tar.xz
blockstorage, refactor: pass GetFirstStoredBlock() start_block by reference
instead of by pointer, so as to not accept a nullptr.
Diffstat (limited to 'src/node/blockstorage.cpp')
-rw-r--r--src/node/blockstorage.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp
index be45eb7ba9..17ab226a30 100644
--- a/src/node/blockstorage.cpp
+++ b/src/node/blockstorage.cpp
@@ -390,11 +390,10 @@ bool BlockManager::IsBlockPruned(const CBlockIndex* pblockindex)
return (m_have_pruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0);
}
-const CBlockIndex* BlockManager::GetFirstStoredBlock(const CBlockIndex* start_block)
+const CBlockIndex* BlockManager::GetFirstStoredBlock(const CBlockIndex& start_block)
{
AssertLockHeld(::cs_main);
- assert(start_block);
- const CBlockIndex* last_block = start_block;
+ const CBlockIndex* last_block = &start_block;
while (last_block->pprev && (last_block->pprev->nStatus & BLOCK_HAVE_DATA)) {
last_block = last_block->pprev;
}