6#ifndef BITCOIN_ADDRDB_H
7#define BITCOIN_ADDRDB_H
55 uint8_t ban_reason = 2;
56 READWRITE(obj.nVersion, obj.nCreateTime, obj.nBanUntil, ban_reason);
79 static constexpr const char *
JSON_KEY =
"banned_nets";
114 const std::vector<CAddress> &anchors);
std::vector< CAddress > ReadAnchors(const CChainParams &chainParams, const fs::path &anchors_db_path)
Read the anchor IP address database (anchors.dat)
util::Result< std::unique_ptr< AddrMan > > LoadAddrman(const CChainParams &chainparams, const std::vector< bool > &asmap, const ArgsManager &args)
Returns an error string on failure.
void ReadFromStream(const CChainParams &chainParams, AddrMan &addr, CDataStream &ssPeers)
Only used by tests.
bool DumpPeerAddresses(const CChainParams &chainParams, const ArgsManager &args, const AddrMan &addr)
void DumpAnchors(const CChainParams &chainParams, const fs::path &anchors_db_path, const std::vector< CAddress > &anchors)
Dump the anchor IP address database (anchors.dat)
Stochastic address manager.
A CService with information about it as peer.
Access to the banlist databases (banlist.json and banlist.dat)
bool Write(const banmap_t &banSet)
bool Read(banmap_t &banSet, bool &dirty)
Read the banlist from disk.
const fs::path m_banlist_dat
CBanDB(fs::path ban_list_path, const CChainParams &_chainParams)
static constexpr const char * JSON_KEY
JSON key under which the data is stored in the json database.
const fs::path m_banlist_json
const CChainParams & chainParams
static const int CURRENT_VERSION
UniValue ToJson() const
Generate a JSON representation of this ban entry.
CBanEntry(int64_t nCreateTimeIn)
SERIALIZE_METHODS(CBanEntry, obj)
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
char const * json() noexcept
Template to generate JSON data.
std::map< CSubNet, CBanEntry > banmap_t