refactor: Remove unused parameter in ReportHeadersPresync
What changed, and why it matters
This is a simple code cleanup: a function called ReportHeadersPresync had a 'work' parameter that was never used, so the commit removes that parameter from the function definition and from every place that calls it. There is no change to program behavior, no bug fix, and no security relevance.
No security action needed; this is a routine refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors ChainstateManager::ReportHeadersPresync by dropping the unused const arith_uint256& work parameter. Callers in net_processing.cpp and the declaration in validation.h are updated accordingly. The function body already did not reference work, so this is a non-functional change.
Changed components
src/net_processing.cppsrc/validation.cppsrc/validation.hInspect captured patch +3 / −3
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 7ab70cd6..578a7d71 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -4620,7 +4620,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
if (it != m_headers_presync_stats.end()) stats = it->second;
}
if (stats.second) {
- m_chainman.ReportHeadersPresync(stats.first, stats.second->first, stats.second->second);
+ m_chainman.ReportHeadersPresync(stats.second->first, stats.second->second);
}
}
diff --git a/src/validation.cpp b/src/validation.cpp
index 99f516cc..88460110 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -4380,7 +4380,7 @@ bool ChainstateManager::ProcessNewBlockHeaders(std::span<const CBlockHeader> hea
return true;
}
-void ChainstateManager::ReportHeadersPresync(const arith_uint256& work, int64_t height, int64_t timestamp)
+void ChainstateManager::ReportHeadersPresync(int64_t height, int64_t timestamp)
{
AssertLockNotHeld(GetMutex());
{
diff --git a/src/validation.h b/src/validation.h
index daf954c8..57baa05f 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -1286,7 +1286,7 @@ public:
* headers are not yet fed to validation during that time, but validation is (for now)
* responsible for logging and signalling through NotifyHeaderTip, so it needs this
* information. */
- void ReportHeadersPresync(const arith_uint256& work, int64_t height, int64_t timestamp);
+ void ReportHeadersPresync(int64_t height, int64_t timestamp);
//! When starting up, search the datadir for a chainstate based on a UTXO
//! snapshot that is in the process of being validated.
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.