Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
addrdb.h
Go to the documentation of this file.
1
// Copyright (c) 2009-2010 Satoshi Nakamoto
2
// Copyright (c) 2009-present The Bitcoin Core developers
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#ifndef BITCOIN_ADDRDB_H
7
#define BITCOIN_ADDRDB_H
8
9
#include <
net_types.h
>
10
#include <
util/fs.h
>
11
#include <
util/result.h
>
12
13
#include <memory>
14
#include <vector>
15
16
class
ArgsManager
;
17
class
AddrMan
;
18
class
CAddress
;
19
class
DataStream
;
20
class
NetGroupManager
;
21
23
void
ReadFromStream
(
AddrMan
& addr,
DataStream
& ssPeers);
24
25
bool
DumpPeerAddresses
(
const
ArgsManager
&
args
,
const
AddrMan
& addr);
26
28
class
CBanDB
29
{
30
private
:
34
static
constexpr
const
char
*
JSON_KEY
=
"banned_nets"
;
35
36
const
fs::path
m_banlist_dat
;
37
const
fs::path
m_banlist_json
;
38
public
:
39
explicit
CBanDB
(fs::path ban_list_path);
40
bool
Write
(
const
banmap_t
& banSet);
41
48
bool
Read
(
banmap_t
& banSet);
49
};
50
52
util::Result<std::unique_ptr<AddrMan>
>
LoadAddrman
(
const
NetGroupManager
& netgroupman,
const
ArgsManager
&
args
);
53
60
void
DumpAnchors
(
const
fs::path& anchors_db_path,
const
std::vector<CAddress>& anchors);
61
68
std::vector<CAddress>
ReadAnchors
(
const
fs::path& anchors_db_path);
69
70
#endif
// BITCOIN_ADDRDB_H
DumpPeerAddresses
bool DumpPeerAddresses(const ArgsManager &args, const AddrMan &addr)
Definition
addrdb.cpp:185
ReadAnchors
std::vector< CAddress > ReadAnchors(const fs::path &anchors_db_path)
Read the anchor IP address database (anchors.dat).
Definition
addrdb.cpp:234
LoadAddrman
util::Result< std::unique_ptr< AddrMan > > LoadAddrman(const NetGroupManager &netgroupman, const ArgsManager &args)
Returns an error string on failure.
Definition
addrdb.cpp:196
ReadFromStream
void ReadFromStream(AddrMan &addr, DataStream &ssPeers)
Only used by tests.
Definition
addrdb.cpp:191
DumpAnchors
void DumpAnchors(const fs::path &anchors_db_path, const std::vector< CAddress > &anchors)
Dump the anchor IP address database (anchors.dat).
Definition
addrdb.cpp:228
args
ArgsManager & args
Definition
bitcoind.cpp:277
AddrMan
Stochastic address manager.
Definition
addrman.h:89
ArgsManager
Definition
args.h:103
CAddress
A CService with information about it as peer.
Definition
protocol.h:367
CBanDB::Write
bool Write(const banmap_t &banSet)
Definition
addrdb.cpp:142
CBanDB::m_banlist_dat
const fs::path m_banlist_dat
Definition
addrdb.h:36
CBanDB::Read
bool Read(banmap_t &banSet)
Read the banlist from disk.
Definition
addrdb.cpp:155
CBanDB::JSON_KEY
static constexpr const char * JSON_KEY
JSON key under which the data is stored in the json database.
Definition
addrdb.h:34
CBanDB::m_banlist_json
const fs::path m_banlist_json
Definition
addrdb.h:37
CBanDB::CBanDB
CBanDB(fs::path ban_list_path)
Definition
addrdb.cpp:136
DataStream
Double ended buffer combining vector and stream-like interfaces.
Definition
streams.h:133
NetGroupManager
Netgroup manager.
Definition
netgroup.h:17
util::Result
Definition
result.h:36
fs.h
net_types.h
banmap_t
std::map< CSubNet, CBanEntry > banmap_t
Definition
net_types.h:41
result.h
Generated on
for Bitcoin Core by
1.17.0