noui: Remove always empty caption while formatting
What changed, and why it matters
This commit is a minor cleanup in Bitcoin Core's non-graphical user interface code. It removes a leftover ': ' prefix that was accidentally added to some log and error messages. There is no security vulnerability here—only a small cosmetic fix that makes error messages display correctly in tests and logs.
No security action required. Treat as normal code maintenance.
Security signals we found
No security-relevant code change
Cosmetic logging/formatting cleanup only
No input handling, memory, cryptography, or network changes
No privilege boundary crossed
Evidence from the diff
The change removes an always-empty caption placeholder in src/noui.cpp’s noui_ThreadSafeMessageBox default branch. Previously, strCaption was unconditionally set to ‘: ’ before logging, causing messages to be prefixed with ‘: ’ even when no caption existed. The patch deletes that assignment so messages are logged without the spurious prefix. Corresponding functional tests are updated to expect messages without the leading ‘: ‘. A related function, noui_ThreadSafeQuestion, is mentioned in the commit message but not modified in the diff.
Changed components
src/noui.cpptest/functional/feature_presegwit_node_upgrade.pytest/functional/feature_reindex_init.pytest/functional/rpc_blockchain.pyInspect captured patch +3 / −4
diff --git a/src/noui.cpp b/src/noui.cpp
index 7451a999..327e17f8 100644
--- a/src/noui.cpp
+++ b/src/noui.cpp
@@ -39,7 +39,6 @@ bool noui_ThreadSafeMessageBox(const bilingual_str& message, unsigned int style)
if (!fSecure) LogInfo("%s\n", message.original);
break;
default:
- strCaption = ": "; // caption is always empty TODO fix this
if (!fSecure) LogInfo("%s%s\n", strCaption, message.original);
}
diff --git a/test/functional/feature_presegwit_node_upgrade.py b/test/functional/feature_presegwit_node_upgrade.py
index 759a9296..bbe190a6 100755
--- a/test/functional/feature_presegwit_node_upgrade.py
+++ b/test/functional/feature_presegwit_node_upgrade.py
@@ -38,7 +38,7 @@ class SegwitUpgradeTest(BitcoinTestFramework):
# because the blockchain consists of 3 insufficiently validated blocks per segwit consensus rules.
node.assert_start_raises_init_error(
extra_args=["-testactivationheight=segwit@5"],
- expected_msg=": Witness data for blocks after height 5 requires "
+ expected_msg="Witness data for blocks after height 5 requires "
f"validation. Please restart with -reindex..{os.linesep}"
"Please restart with -reindex or -reindex-chainstate to recover.",
)
diff --git a/test/functional/feature_reindex_init.py b/test/functional/feature_reindex_init.py
index d031355e..d2ef6c5e 100755
--- a/test/functional/feature_reindex_init.py
+++ b/test/functional/feature_reindex_init.py
@@ -21,7 +21,7 @@ class ReindexInitTest(BitcoinTestFramework):
self.log.info("Removing the block index leads to init error")
shutil.rmtree(node.blocks_path / "index")
node.assert_start_raises_init_error(
- expected_msg=f": Error initializing block database.{os.linesep}"
+ expected_msg=f"Error initializing block database.{os.linesep}"
"Please restart with -reindex or -reindex-chainstate to recover.",
)
diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py
index 3c011c09..5c1f2ee4 100755
--- a/test/functional/rpc_blockchain.py
+++ b/test/functional/rpc_blockchain.py
@@ -124,7 +124,7 @@ class BlockchainTest(BitcoinTestFramework):
self.log.info("A block tip of more than MAX_FUTURE_BLOCK_TIME in the future raises an error")
self.nodes[0].assert_start_raises_init_error(
extra_args=[f"-mocktime={TIME_RANGE_TIP - MAX_FUTURE_BLOCK_TIME - 1}"],
- expected_msg=": The block database contains a block which appears to be from the future."
+ expected_msg="The block database contains a block which appears to be from the future."
" This may be due to your computer's date and time being set incorrectly."
f" Only rebuild the block database if you are sure that your computer's date and time are correct.{os.linesep}"
"Please restart with -reindex or -reindex-chainstate to recover.",
Why this scored 17/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.