Bitcoin Core
28.99.0
P2P Digital Currency
Toggle main menu visibility
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Typedefs
b
c
e
f
i
k
l
m
n
o
p
s
t
v
w
Enumerations
a
b
c
d
e
f
i
l
m
p
r
s
t
u
w
Enumerator
a
b
c
d
e
f
h
i
l
m
n
p
q
r
s
t
u
v
w
z
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
!
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
!
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
m
o
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Properties
Related Functions
a
b
c
d
e
f
i
l
m
o
p
r
s
t
u
v
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Typedefs
b
c
d
e
f
h
l
m
n
p
r
s
t
u
v
w
Enumerations
b
c
d
e
f
g
h
i
j
m
n
o
p
r
s
t
v
Enumerator
a
b
c
d
e
g
h
i
j
l
m
n
o
p
r
s
t
u
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
p
q
r
s
t
u
v
w
x
y
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Concepts
src
net_types.h
Go to the documentation of this file.
1
// Copyright (c) 2019-2021 The Bitcoin Core 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
#ifndef BITCOIN_NET_TYPES_H
6
#define BITCOIN_NET_TYPES_H
7
8
#include <cstdint>
9
#include <map>
10
11
class
CSubNet
;
12
class
UniValue
;
13
14
class
CBanEntry
15
{
16
public
:
17
static
constexpr
int
CURRENT_VERSION
{1};
18
int
nVersion
{
CBanEntry::CURRENT_VERSION
};
19
int64_t
nCreateTime
{0};
20
int64_t
nBanUntil
{0};
21
22
CBanEntry
() =
default
;
23
24
explicit
CBanEntry
(int64_t nCreateTimeIn)
25
:
nCreateTime
{nCreateTimeIn} {}
26
32
explicit
CBanEntry
(
const
UniValue
&
json
);
33
38
UniValue
ToJson
()
const
;
39
};
40
41
using
banmap_t
= std::map<CSubNet, CBanEntry>;
42
49
UniValue
BanMapToJson
(
const
banmap_t
& bans);
50
58
void
BanMapFromJson
(
const
UniValue
& bans_json,
banmap_t
& bans);
59
60
#endif
// BITCOIN_NET_TYPES_H
CBanEntry
Definition:
net_types.h:15
CBanEntry::CBanEntry
CBanEntry()=default
CBanEntry::nCreateTime
int64_t nCreateTime
Definition:
net_types.h:19
CBanEntry::ToJson
UniValue ToJson() const
Generate a JSON representation of this ban entry.
Definition:
net_types.cpp:21
CBanEntry::CBanEntry
CBanEntry(int64_t nCreateTimeIn)
Definition:
net_types.h:24
CBanEntry::nVersion
int nVersion
Definition:
net_types.h:18
CBanEntry::nBanUntil
int64_t nBanUntil
Definition:
net_types.h:20
CBanEntry::CURRENT_VERSION
static constexpr int CURRENT_VERSION
Definition:
net_types.h:17
CSubNet
Definition:
netaddress.h:480
UniValue
Definition:
univalue.h:22
ankerl::nanobench::templates::json
char const * json() noexcept
Template to generate JSON data.
BanMapFromJson
void BanMapFromJson(const UniValue &bans_json, banmap_t &bans)
Convert a JSON array to a banmap_t object.
Definition:
net_types.cpp:58
banmap_t
std::map< CSubNet, CBanEntry > banmap_t
Definition:
net_types.h:41
BanMapToJson
UniValue BanMapToJson(const banmap_t &bans)
Convert a banmap_t object to a JSON array.
Definition:
net_types.cpp:38
Generated on Sun Dec 22 2024 20:00:14 for Bitcoin Core by
1.9.4