Bitcoin Core  22.99.0
P2P Digital Currency
Classes | Typedefs | Functions
net_types.h File Reference
#include <cstdint>
#include <map>
Include dependency graph for net_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CBanEntry
 

Typedefs

using banmap_t = std::map< CSubNet, CBanEntry >
 

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...
 

Typedef Documentation

◆ banmap_t

using banmap_t = std::map<CSubNet, CBanEntry>

Definition at line 41 of file net_types.h.

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 54 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 34 of file net_types.cpp.

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