Bitcoin Core 28.99.0
P2P Digital Currency
Functions | Variables
net_types.cpp File Reference
#include <net_types.h>
#include <logging.h>
#include <netaddress.h>
#include <netbase.h>
#include <univalue.h>
Include dependency graph for net_types.cpp:

Go to the source code of this file.

Functions

UniValue BanMapToJson (const banmap_t &bans)
 Convert a banmap_t object to a JSON array. More...
 
void BanMapFromJson (const UniValue &bans_json, banmap_t &bans)
 Convert a JSON array to a banmap_t object. More...
 

Variables

static const char * BANMAN_JSON_VERSION_KEY {"version"}
 
static const char * BANMAN_JSON_ADDR_KEY = "address"
 

Function Documentation

◆ BanMapFromJson()

void BanMapFromJson ( const UniValue bans_json,
banmap_t bans 
)

Convert a JSON array to a banmap_t object.

Parameters
[in]bans_jsonJSON to convert, must be as returned by BanMapToJson().
[out]bansBans list to create from the JSON.
Exceptions
std::runtime_errorif the JSON does not have the expected fields or they contain unparsable values.

Definition at line 58 of file net_types.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BanMapToJson()

UniValue BanMapToJson ( const banmap_t bans)

Convert a banmap_t object to a JSON array.

Parameters
[in]bansBans list to convert.
Returns
a JSON array, similar to the one returned by the listbanned RPC. Suitable for passing to BanMapFromJson().

Definition at line 38 of file net_types.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ BANMAN_JSON_ADDR_KEY

const char* BANMAN_JSON_ADDR_KEY = "address"
static

Definition at line 30 of file net_types.cpp.

◆ BANMAN_JSON_VERSION_KEY

const char* BANMAN_JSON_VERSION_KEY {"version"}
static

Definition at line 12 of file net_types.cpp.