Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
CBanEntry Class Reference

#include <net_types.h>

Public Member Functions

 CBanEntry ()
 
 CBanEntry (int64_t nCreateTimeIn)
 
 CBanEntry (const UniValue &json)
 Create a ban entry from JSON. More...
 
UniValue ToJson () const
 Generate a JSON representation of this ban entry. More...
 

Public Attributes

int nVersion {CBanEntry::CURRENT_VERSION}
 
int64_t nCreateTime {0}
 
int64_t nBanUntil {0}
 

Static Public Attributes

static constexpr int CURRENT_VERSION {1}
 

Detailed Description

Definition at line 14 of file net_types.h.

Constructor & Destructor Documentation

◆ CBanEntry() [1/3]

CBanEntry::CBanEntry ( )
inline

Definition at line 22 of file net_types.h.

◆ CBanEntry() [2/3]

CBanEntry::CBanEntry ( int64_t  nCreateTimeIn)
inlineexplicit

Definition at line 24 of file net_types.h.

◆ CBanEntry() [3/3]

CBanEntry::CBanEntry ( const UniValue json)
explicit

Create a ban entry from JSON.

Parameters
[in]jsonA JSON representation of a ban entry, as created by ToJson().
Exceptions
std::runtime_errorif the JSON does not have the expected fields.

Definition at line 14 of file net_types.cpp.

Member Function Documentation

◆ ToJson()

UniValue CBanEntry::ToJson ( ) const

Generate a JSON representation of this ban entry.

Returns
JSON suitable for passing to the CBanEntry(const UniValue&) constructor.

Definition at line 21 of file net_types.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ CURRENT_VERSION

constexpr int CBanEntry::CURRENT_VERSION {1}
staticconstexpr

Definition at line 17 of file net_types.h.

◆ nBanUntil

int64_t CBanEntry::nBanUntil {0}

Definition at line 20 of file net_types.h.

◆ nCreateTime

int64_t CBanEntry::nCreateTime {0}

Definition at line 19 of file net_types.h.

◆ nVersion

int CBanEntry::nVersion {CBanEntry::CURRENT_VERSION}

Definition at line 18 of file net_types.h.


The documentation for this class was generated from the following files: