Changeset View
Changeset View
Standalone View
Standalone View
src/addrdb.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_ADDRDB_H | #ifndef BITCOIN_ADDRDB_H | ||||
#define BITCOIN_ADDRDB_H | #define BITCOIN_ADDRDB_H | ||||
#include <fs.h> | #include <fs.h> | ||||
#include <net_types.h> // For banmap_t | #include <net_types.h> // For banmap_t | ||||
#include <serialize.h> | #include <serialize.h> | ||||
#include <map> | |||||
#include <string> | #include <string> | ||||
#include <vector> | |||||
class CSubNet; | class CAddress; | ||||
class CAddrMan; | class CAddrMan; | ||||
class CDataStream; | class CDataStream; | ||||
class CChainParams; | class CChainParams; | ||||
class CBanEntry { | class CBanEntry { | ||||
public: | public: | ||||
static const int CURRENT_VERSION = 1; | static const int CURRENT_VERSION = 1; | ||||
int nVersion; | int nVersion; | ||||
Show All 40 Lines | private: | ||||
const CChainParams &chainParams; | const CChainParams &chainParams; | ||||
public: | public: | ||||
CBanDB(fs::path ban_list_path, const CChainParams &_chainParams); | CBanDB(fs::path ban_list_path, const CChainParams &_chainParams); | ||||
bool Write(const banmap_t &banSet); | bool Write(const banmap_t &banSet); | ||||
bool Read(banmap_t &banSet); | bool Read(banmap_t &banSet); | ||||
}; | }; | ||||
/** | |||||
* Dump the anchor IP address database (anchors.dat) | |||||
* | |||||
* Anchors are last known outgoing block-relay-only peers that are | |||||
* tried to re-connect to on startup. | |||||
*/ | |||||
void DumpAnchors(const CChainParams &chainParams, | |||||
const fs::path &anchors_db_path, | |||||
const std::vector<CAddress> &anchors); | |||||
#endif // BITCOIN_ADDRDB_H | #endif // BITCOIN_ADDRDB_H |