mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
RPC/rpcdoccheck: Error if a oneline_description has a quote for a non-string
This commit is contained in:
parent
7c61e9df90
commit
de319c6175
1 changed files with 10 additions and 1 deletions
|
@ -1117,7 +1117,16 @@ std::string RPCArg::ToStringObj(const bool oneline) const
|
|||
|
||||
std::string RPCArg::ToString(const bool oneline) const
|
||||
{
|
||||
if (oneline && !m_opts.oneline_description.empty()) return m_opts.oneline_description;
|
||||
if (oneline && !m_opts.oneline_description.empty()) {
|
||||
if (m_opts.oneline_description[0] == '\"' && m_type != Type::STR_HEX && m_type != Type::STR && gArgs.GetBoolArg("-rpcdoccheck", DEFAULT_RPC_DOC_CHECK)) {
|
||||
throw std::runtime_error{
|
||||
strprintf("Internal bug detected: non-string RPC arg \"%s\" quotes oneline_description:\n%s\n%s %s\nPlease report this issue here: %s\n",
|
||||
m_names, m_opts.oneline_description,
|
||||
PACKAGE_NAME, FormatFullVersion(),
|
||||
PACKAGE_BUGREPORT)};
|
||||
}
|
||||
return m_opts.oneline_description;
|
||||
}
|
||||
|
||||
switch (m_type) {
|
||||
case Type::STR_HEX:
|
||||
|
|
Loading…
Add table
Reference in a new issue