mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
util: Add CHECK_NONFATAL and use it in src/rpc
This commit is contained in:
@@ -3,15 +3,16 @@
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <key_io.h>
|
||||
#include <httpserver.h>
|
||||
#include <key_io.h>
|
||||
#include <outputtype.h>
|
||||
#include <rpc/blockchain.h>
|
||||
#include <rpc/server.h>
|
||||
#include <rpc/util.h>
|
||||
#include <script/descriptor.h>
|
||||
#include <util/system.h>
|
||||
#include <util/check.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/system.h>
|
||||
#include <util/validation.h>
|
||||
|
||||
#include <stdint.h>
|
||||
@@ -540,6 +541,7 @@ static UniValue echo(const JSONRPCRequest& request)
|
||||
throw std::runtime_error(
|
||||
RPCHelpMan{"echo|echojson ...",
|
||||
"\nSimply echo back the input arguments. This command is for testing.\n"
|
||||
"\nIt will return an internal bug report when exactly 100 arguments are passed.\n"
|
||||
"\nThe difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in "
|
||||
"bitcoin-cli and the GUI. There is no server-side difference.",
|
||||
{},
|
||||
@@ -548,6 +550,8 @@ static UniValue echo(const JSONRPCRequest& request)
|
||||
}.ToString()
|
||||
);
|
||||
|
||||
CHECK_NONFATAL(request.params.size() != 100);
|
||||
|
||||
return request.params;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user