iwyu: Add temporary mapping to work around upstream bug
What changed, and why it matters
This commit is a minor housekeeping change. It removes two unused '#include <iterator>' lines from source files and adds a temporary mapping for a third-party code-tidying tool (IWYU) to work around a known upstream bug. There is no change to Bitcoin's actual logic, networking, cryptography, or consensus behavior, and no security relevance.
No security action required. Treat as normal code-quality/maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch removes the ‘#include
Changed components
contrib/devtools/iwyu/bitcoin.core.impsrc/crypto/chacha20.hsrc/index/txindex.cppInspect captured patch +3 / −3
diff --git a/contrib/devtools/iwyu/bitcoin.core.imp b/contrib/devtools/iwyu/bitcoin.core.imp
index 03bafc3d..90d65bea 100644
--- a/contrib/devtools/iwyu/bitcoin.core.imp
+++ b/contrib/devtools/iwyu/bitcoin.core.imp
@@ -9,7 +9,9 @@
{ "symbol": ["AT_HWCAP", "private", "<sys/auxv.h>", "public"] },
{ "symbol": ["AT_HWCAP2", "private", "<sys/auxv.h>", "public"] },
- # IWYU bug.
+ # Workarounds for IWYU issues.
+ # See: https://github.com/include-what-you-use/include-what-you-use/issues/1616.
+ { "symbol": ["std::pair", "private", "<utility>", "public"] },
# See: https://github.com/include-what-you-use/include-what-you-use/issues/1863.
{ "symbol": ["std::vector", "private", "<vector>", "public"] },
]
diff --git a/src/crypto/chacha20.h b/src/crypto/chacha20.h
index 15035621..3feef196 100644
--- a/src/crypto/chacha20.h
+++ b/src/crypto/chacha20.h
@@ -8,7 +8,6 @@
#include <array>
#include <cstddef>
#include <cstdint>
-#include <iterator>
#include <span>
#include <utility>
diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp
index 7d845021..d7d8cb56 100644
--- a/src/index/txindex.cpp
+++ b/src/index/txindex.cpp
@@ -24,7 +24,6 @@
#include <cstdint>
#include <cstdio>
#include <exception>
-#include <iterator>
#include <span>
#include <string>
#include <utility>
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.