iwyu, doc: Document `IWYU pragma: export` for `<chrono>`
What changed, and why it matters
This is a minor code cleanup and documentation change. It replaces direct includes of the standard C++ time library (`<chrono>`) in two files with a project-specific header (`util/time.h`) and adds a comment explaining that `util/time.h` is intended as a drop-in replacement for `<chrono>`. There is no functional code change and no security impact.
No security action needed. This is a routine maintainability/refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit is an ‘include-what-you-use’ (IWYU) and documentation refactor. src/kernel/mempool_entry.h and src/kernel/mempool_options.h now include util/time.h instead of <chrono>. src/util/time.h gains a comment and an IWYU pragma: export marker on its <chrono> include, telling static analysis tools that consumers of util/time.h also get the <chrono> symbols. No logic, interfaces, or behavior changed.
Changed components
src/kernel/mempool_entry.hsrc/kernel/mempool_options.hsrc/util/time.hInspect captured patch +3 / −2
diff --git a/src/kernel/mempool_entry.h b/src/kernel/mempool_entry.h
index dd0c23a2..29ca1fd0 100644
--- a/src/kernel/mempool_entry.h
+++ b/src/kernel/mempool_entry.h
@@ -13,8 +13,8 @@
#include <primitives/transaction.h>
#include <txgraph.h>
#include <util/overflow.h>
+#include <util/time.h>
-#include <chrono>
#include <cstddef>
#include <cstdint>
#include <functional>
diff --git a/src/kernel/mempool_options.h b/src/kernel/mempool_options.h
index a18d565c..392c837f 100644
--- a/src/kernel/mempool_options.h
+++ b/src/kernel/mempool_options.h
@@ -8,8 +8,8 @@
#include <policy/feerate.h>
#include <policy/policy.h>
+#include <util/time.h>
-#include <chrono>
#include <cstdint>
#include <optional>
diff --git a/src/util/time.h b/src/util/time.h
index 967ea780..30d363bb 100644
--- a/src/util/time.h
+++ b/src/util/time.h
@@ -6,6 +6,7 @@
#ifndef BITCOIN_UTIL_TIME_H
#define BITCOIN_UTIL_TIME_H
+// The `util/time.h` header is designed to be a drop-in replacement for `chrono`.
#include <chrono> // IWYU pragma: export
#include <cstdint>
#include <optional>
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.