serialize: Add missing `<span>` header
What changed, and why it matters
This is a routine code cleanup: a missing standard library header is added to one central file, allowing nine other files to stop including it directly. It does not change program behavior or fix any security issue.
No security action required. Treat as normal refactoring/cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds #include <span> to src/serialize.h and removes redundant #include <span> lines from nine .cpp files. This is an Include-What-You-Use (IWYU) hygiene change. The header was already being pulled in transitively; the change makes the dependency explicit in the header that actually uses std::span. No functional code is modified.
Changed components
src/serialize.hsrc/index/base.cppsrc/index/blockfilterindex.cppsrc/index/coinstatsindex.cppsrc/index/txindex.cppsrc/index/txospenderindex.cppsrc/kernel/coinstats.cppsrc/node/utxo_snapshot.cppsrc/primitives/block.cppsrc/zmq/zmqpublishnotifier.cppInspect captured patch +1 / −9
diff --git a/src/index/base.cpp b/src/index/base.cpp
index fba2f4f6..851b3cda 100644
--- a/src/index/base.cpp
+++ b/src/index/base.cpp
@@ -35,7 +35,6 @@
#include <cstdint>
#include <memory>
#include <optional>
-#include <span>
#include <stdexcept>
#include <string>
#include <thread>
diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp
index 67fa1fab..e63aa4a3 100644
--- a/src/index/blockfilterindex.cpp
+++ b/src/index/blockfilterindex.cpp
@@ -28,7 +28,6 @@
#include <exception>
#include <map>
#include <optional>
-#include <span>
#include <stdexcept>
#include <string>
#include <tuple>
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp
index 319ffcad..80a6d8df 100644
--- a/src/index/coinstatsindex.cpp
+++ b/src/index/coinstatsindex.cpp
@@ -30,7 +30,6 @@
#include <compare>
#include <limits>
-#include <span>
#include <string>
#include <utility>
#include <vector>
diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp
index d0e88021..4b0c8287 100644
--- a/src/index/txindex.cpp
+++ b/src/index/txindex.cpp
@@ -24,7 +24,6 @@
#include <cstdint>
#include <cstdio>
#include <exception>
-#include <span>
#include <string>
#include <utility>
#include <vector>
diff --git a/src/index/txospenderindex.cpp b/src/index/txospenderindex.cpp
index d451bb1e..f0d559a9 100644
--- a/src/index/txospenderindex.cpp
+++ b/src/index/txospenderindex.cpp
@@ -26,7 +26,6 @@
#include <cstdio>
#include <exception>
#include <ios>
-#include <span>
#include <string>
#include <utility>
#include <vector>
diff --git a/src/kernel/coinstats.cpp b/src/kernel/coinstats.cpp
index 49b51d64..4e30a876 100644
--- a/src/kernel/coinstats.cpp
+++ b/src/kernel/coinstats.cpp
@@ -22,7 +22,6 @@
#include <map>
#include <memory>
-#include <span>
#include <utility>
#include <version>
diff --git a/src/node/utxo_snapshot.cpp b/src/node/utxo_snapshot.cpp
index e5997b7b..4b61a76c 100644
--- a/src/node/utxo_snapshot.cpp
+++ b/src/node/utxo_snapshot.cpp
@@ -15,7 +15,6 @@
#include <cassert>
#include <cstdio>
#include <optional>
-#include <span>
#include <string>
namespace node {
diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp
index dfeed295..0e81b74d 100644
--- a/src/primitives/block.cpp
+++ b/src/primitives/block.cpp
@@ -9,7 +9,6 @@
#include <tinyformat.h>
#include <memory>
-#include <span>
#include <sstream>
uint256 CBlockHeader::GetHash() const
diff --git a/src/serialize.h b/src/serialize.h
index 9c18c727..4c33311c 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -22,6 +22,7 @@
#include <map>
#include <memory>
#include <set>
+#include <span>
#include <string>
#include <utility>
#include <vector>
diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp
index 56cdea05..61b65a13 100644
--- a/src/zmq/zmqpublishnotifier.cpp
+++ b/src/zmq/zmqpublishnotifier.cpp
@@ -24,7 +24,6 @@
#include <cstring>
#include <map>
#include <optional>
-#include <span>
#include <string>
#include <utility>
#include <vector>
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.