refactor: add missing LIFETIMEBOUND annotation for parameter
What changed, and why it matters
This is a code-quality annotation change only. It tells the compiler that a function parameter's lifetime is tied to the returned value, which helps catch misuse during development. It does not change program behavior or fix a runtime security bug.
No security action required. Treat as normal code-quality/maintenance change.
Security signals we found
No security signal: change is a compile-time annotation only
No memory-safety bug is fixed in the diff
No change to logic, control flow, or data handling
Evidence from the diff
The commit adds a LIFETIMEBOUND annotation to the lower_block parameter of BlockManager::GetFirstBlock. LIFETIMEBOUND is a compile-time hint (a custom attribute used by Bitcoin Core’s static-analysis tooling) that warns if a temporary or short-lived object is passed where a longer-lived reference is required. The change is purely a refactor; it does not alter generated code, memory layout, or runtime semantics.
Changed components
src/node/blockstorage.hBlockManager::GetFirstBlock declarationInspect captured patch +1 / −1
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h
index 9a619919..4ee75f07 100644
--- a/src/node/blockstorage.h
+++ b/src/node/blockstorage.h
@@ -429,7 +429,7 @@ public:
const CBlockIndex* GetFirstBlock(
const CBlockIndex& upper_block LIFETIMEBOUND,
uint32_t status_mask,
- const CBlockIndex* lower_block = nullptr
+ const CBlockIndex* lower_block LIFETIMEBOUND = nullptr
) const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
/** True if any block files have ever been pruned. */
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.