5#ifndef BITCOIN_SEEDER_DB_H
6#define BITCOIN_SEEDER_DB_H
8#include <chainparams.h>
26#define REQUIRE_VERSION 70001
39 while (str.size() < 22) {
308 int blocks,
uint64_t services,
bool checkpointVerified);
329 if (
ourId.size() > 0) {
337 for (std::map<int, SeederAddrInfo>::iterator it =
idToInfo.begin();
339 (*it).second.ignoreTill = 0;
344 std::vector<CAddrReport>
ret;
346 for (std::deque<int>::const_iterator it =
ourId.begin();
347 it !=
ourId.end(); it++) {
374 for (std::deque<int>::const_iterator it =
ourId.begin();
375 it !=
ourId.end(); it++) {
376 std::map<int, SeederAddrInfo>::iterator
ci =
db->
idToInfo.find(*it);
379 for (std::set<int>::const_iterator it =
unkId.begin();
380 it !=
unkId.end(); it++) {
381 std::map<int, SeederAddrInfo>::iterator
ci =
db->
idToInfo.find(*it);
397 for (
int i = 0; i < n; i++) {
423 void Add(
const std::vector<CAddress> &vAddr,
bool fForce =
false) {
425 for (
size_t i = 0; i < vAddr.size(); i++) {
444 for (
size_t i = 0; i <
ips.size(); i++) {
448 ips[i].checkpointVerified);
const CChainParams & Params()
Return the currently selected parameters.
void Add(const CAddress &addr, bool fForce=false)
void GetMany(std::vector< CServiceResult > &ips, int max)
void Bad_(const CService &ip, int ban)
void ResultMany(const std::vector< CServiceResult > &ips)
void GetStats(CAddrDbStats &stats) const
void GetIPs_(std::set< CNetAddr > &ips, uint64_t requestedFlags, uint32_t max, const bool *nets)
void Good_(const CService &ip, int clientV, std::string clientSV, int blocks, uint64_t services, bool checkpointVerified)
std::vector< CAddrReport > GetAll()
void GetIPs(std::set< CNetAddr > &ips, uint64_t requestedFlags, uint32_t max, const bool *nets)
void Unserialize(Stream &s)
std::map< CService, int > ipToId
std::map< CService, int64_t > banned
std::map< int, SeederAddrInfo > idToInfo
bool Get_(CServiceResult &ip)
void Add(const std::vector< CAddress > &vAddr, bool fForce=false)
void Serialize(Stream &s) const
void Add_(const CAddress &addr, bool force)
int Lookup_(const CService &ip)
std::string clientSubVersion
ReliabilityStatus reliabilityStatus
SERIALIZE_METHODS(CAddrStat, obj)
void Update(bool good, int64_t age, double tau)
A CService with information about it as peer.
const CCheckpointData & Checkpoints() const
A combination of a network address (CNetAddr) and a (TCP) port.
std::string ToString() const
SERIALIZE_METHODS(SeederAddrInfo, obj)
int64_t GetIgnoreTime() const
CAddrReport GetReport() const
int64_t GetBanTime() const
std::string clientSubVersion
ReliabilityStatus GetReliabilityStatus() const
static const uint8_t tau[]
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
static int GetRequireHeight()
static bool HasCheckpoint()
static std::string ToString(const CService &ip)
#define SER_WRITE(obj, code)
#define SER_READ(obj, code)
MapCheckpoints mapCheckpoints
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.