rpc: Reject beginning newline in RPC docs

It is harmless, but a bit confusing and not needed for new code.

Also, update the remaining instances that were not found by the
scripted-diff.
This commit is contained in:
MarcoFalke
2025-05-15 15:26:17 +02:00
parent fa414eda08
commit fae840e94b
4 changed files with 15 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2017-2022 The Bitcoin Core developers
// Copyright (c) 2017-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -814,6 +814,7 @@ std::string RPCHelpMan::ToString() const
if (was_optional) ret += " )";
// Description
CHECK_NONFATAL(!m_description.starts_with('\n')); // Historically \n was required, but reject it for new code.
ret += "\n\n" + TrimString(m_description) + "\n";
// Arguments