refactor: remove incorrect LIFETIMEBOUND annotations
What changed, and why it matters
This commit removes two compiler-hint annotations (LIFETIMEBOUND) that were technically incorrect. The function only inspects the input objects during the call and does not keep pointers or references to them afterward. Removing the annotations prevents the compiler from enforcing lifetime rules that do not actually apply, but it does not change runtime behavior or fix any active security bug.
No security action required. Treat as a normal code-quality refactor.
Security signals we found
No security signal: change is a compile-time annotation cleanup
No memory safety defect is fixed or introduced by the diff
No change to call sites, logic, or data flow
Evidence from the diff
The patch removes LIFETIMEBOUND annotations from the parameters of BlockManager::CheckBlockDataAvailability. LIFETIMEBOUND is a Clang attribute used to warn when a temporary object’s lifetime would not extend long enough for a returned reference. Here, the function returns bool and does not return or store references to upper_block or lower_block, so the annotations were misleading. The change is a header-only cleanup with no functional code change.
Changed components
src/node/blockstorage.hBlockManager::CheckBlockDataAvailability declarationInspect captured patch +1 / −1
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h
index d5da95c7..9a619919 100644
--- a/src/node/blockstorage.h
+++ b/src/node/blockstorage.h
@@ -402,7 +402,7 @@ public:
//! Check if all blocks in the [upper_block, lower_block] range have data available.
//! The caller is responsible for ensuring that lower_block is an ancestor of upper_block
//! (part of the same chain).
- bool CheckBlockDataAvailability(const CBlockIndex& upper_block LIFETIMEBOUND, const CBlockIndex& lower_block LIFETIMEBOUND) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
+ bool CheckBlockDataAvailability(const CBlockIndex& upper_block, const CBlockIndex& lower_block) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
/**
* @brief Returns the earliest block with specified `status_mask` flags set after
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.