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 <serialize.h> | #include <serialize.h> | ||||
#include <map> | #include <map> | ||||
#include <string> | #include <string> | ||||
class CSubNet; | class CSubNet; | ||||
class CAddrMan; | class CAddrMan; | ||||
class CDataStream; | class CDataStream; | ||||
Show All 27 Lines | public: | ||||
void SetNull() { | void SetNull() { | ||||
nVersion = CBanEntry::CURRENT_VERSION; | nVersion = CBanEntry::CURRENT_VERSION; | ||||
nCreateTime = 0; | nCreateTime = 0; | ||||
nBanUntil = 0; | nBanUntil = 0; | ||||
} | } | ||||
}; | }; | ||||
typedef std::map<CSubNet, CBanEntry> banmap_t; | |||||
/** Access to the (IP) address database (peers.dat) */ | /** Access to the (IP) address database (peers.dat) */ | ||||
class CAddrDB { | class CAddrDB { | ||||
private: | private: | ||||
fs::path pathAddr; | fs::path pathAddr; | ||||
const CChainParams &chainParams; | const CChainParams &chainParams; | ||||
public: | public: | ||||
explicit CAddrDB(const CChainParams &chainParams); | explicit CAddrDB(const CChainParams &chainParams); | ||||
Show All 18 Lines |