Bitcoin ABC
0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
src
rpc
abc.cpp
Go to the documentation of this file.
1
// Copyright (c) 2017-2020 The Bitcoin developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <config.h>
6
#include <
rpc/server.h
>
7
#include <rpc/util.h>
8
9
#include <
univalue.h
>
10
11
static
RPCHelpMan
getexcessiveblock
() {
12
return
RPCHelpMan
{
13
"getexcessiveblock"
,
14
"Return the excessive block size."
,
15
{},
16
RPCResult
{
RPCResult::Type::OBJ
,
17
""
,
18
""
,
19
{
20
RPCResult
{
RPCResult::Type::NUM
,
""
,
21
"excessive block size in bytes"
},
22
}},
23
RPCExamples
{
HelpExampleCli
(
"getexcessiveblock"
,
""
) +
24
HelpExampleRpc
(
"getexcessiveblock"
,
""
)},
25
[&](
const
RPCHelpMan
&
self
,
const
Config
&config,
26
const
JSONRPCRequest
&request) ->
UniValue
{
27
UniValue
ret
(
UniValue::VOBJ
);
28
ret
.pushKV(
"excessiveBlockSize"
, config.GetMaxBlockSize());
29
return
ret
;
30
},
31
};
32
}
33
34
void
RegisterABCRPCCommands
(
CRPCTable
&
t
) {
35
// clang-format off
36
static
const
CRPCCommand
commands[] = {
37
// category actor (function)
38
// ------------------ ----------------------
39
{
"network"
,
getexcessiveblock
, },
40
};
41
// clang-format on
42
43
for
(
const
auto
&
c
: commands) {
44
t
.appendCommand(
c
.name, &
c
);
45
}
46
}
RegisterABCRPCCommands
void RegisterABCRPCCommands(CRPCTable &t)
Definition
abc.cpp:34
getexcessiveblock
static RPCHelpMan getexcessiveblock()
Definition
abc.cpp:11
CRPCCommand
Definition
server.h:147
CRPCTable
RPC command dispatcher.
Definition
server.h:194
Config
Definition
config.h:19
JSONRPCRequest
Definition
request.h:30
RPCHelpMan
Definition
util.h:361
UniValue
Definition
univalue.h:25
UniValue::VOBJ
@ VOBJ
Definition
univalue.h:31
GetRand
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition
random.h:85
HelpExampleCli
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
Definition
util.cpp:150
HelpExampleRpc
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
Definition
util.cpp:167
server.h
RPCExamples
Definition
util.h:353
RPCResult
Definition
util.h:263
RPCResult::Type::NUM
@ NUM
RPCResult::Type::OBJ
@ OBJ
univalue.h
Generated on Thu Dec 26 2024 02:38:04 for Bitcoin ABC by
1.9.8