log: introduce a new category for private broadcast
What changed, and why it matters
This commit simply adds a new logging category named 'privatebroadcast' to Bitcoin Core's logging system. It does not change any network behavior, privacy rules, or security logic. It only gives developers and users a new on/off switch for log messages that will be added separately.
No security action needed. Review future commits that actually use this category to ensure private broadcast messages are logged appropriately and not exposed by default.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch defines a new BCLog::LogFlags value PRIVBROADCAST (bit 30) and registers the string ‘privatebroadcast’ in the LOG_CATEGORIES_MAP. No log statements are converted to this category yet, and no functional code is modified. It is a preparatory logging infrastructure change.
Changed components
src/logging.cppsrc/logging.hInspect captured patch +2 / −0
diff --git a/src/logging.cpp b/src/logging.cpp
index 5fb42bba..838ec4be 100644
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -202,6 +202,7 @@ static const std::map<std::string, BCLog::LogFlags, std::less<>> LOG_CATEGORIES_
{"scan", BCLog::SCAN},
{"txpackages", BCLog::TXPACKAGES},
{"kernel", BCLog::KERNEL},
+ {"privatebroadcast", BCLog::PRIVBROADCAST},
};
static const std::unordered_map<BCLog::LogFlags, std::string> LOG_CATEGORIES_BY_FLAG{
diff --git a/src/logging.h b/src/logging.h
index 29f51085..2a9be6ab 100644
--- a/src/logging.h
+++ b/src/logging.h
@@ -96,6 +96,7 @@ namespace BCLog {
SCAN = (CategoryMask{1} << 27),
TXPACKAGES = (CategoryMask{1} << 28),
KERNEL = (CategoryMask{1} << 29),
+ PRIVBROADCAST = (CategoryMask{1} << 30),
ALL = ~NONE,
};
enum class Level {
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.