test: forbid copying of DebugLogHelper
What changed, and why it matters
This is a small test-only code cleanup that prevents a helper class used only in tests from being accidentally copied. It does not affect the live Bitcoin network software, wallets, consensus rules, or any user-facing functionality. There is no security issue being fixed here.
No action needed. This is a routine test-code quality improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds deleted copy constructor and copy assignment operator to DebugLogHelper in src/test/util/logging.h, making the class non-copyable. DebugLogHelper is a test utility that temporarily intercepts debug log output to detect expected log messages. The change is purely defensive C++ hygiene within the test suite and has no runtime effect on bitcoind or bitcoin-qt.
Changed components
src/test/util/logging.hInspect captured patch +3 / −0
diff --git a/src/test/util/logging.h b/src/test/util/logging.h
index 104a21f9..cd6cb14d 100644
--- a/src/test/util/logging.h
+++ b/src/test/util/logging.h
@@ -27,6 +27,9 @@ public:
explicit DebugLogHelper(std::string message, MatchFn match = [](const std::string*){ return true; });
+ DebugLogHelper(const DebugLogHelper&) = delete;
+ DebugLogHelper& operator=(const DebugLogHelper&) = delete;
+
~DebugLogHelper();
private:
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.