Changeset View
Changeset View
Standalone View
Standalone View
src/banman.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2017 The Bitcoin Core developers | // Copyright (c) 2009-2017 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_BANMAN_H | #ifndef BITCOIN_BANMAN_H | ||||
#define BITCOIN_BANMAN_H | #define BITCOIN_BANMAN_H | ||||
#include <addrdb.h> | #include <addrdb.h> | ||||
#include <bloom.h> | #include <bloom.h> | ||||
#include <fs.h> | #include <fs.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <chrono> | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <memory> | #include <memory> | ||||
// Default 24-hour ban. | // Default 24-hour ban. | ||||
// NOTE: When adjusting this, update rpcnet:setban's help ("24h") | // NOTE: When adjusting this, update rpcnet:setban's help ("24h") | ||||
static constexpr unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; | static constexpr unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; | ||||
// How often to dump addresses to banlist.dat | |||||
static constexpr std::chrono::minutes DUMP_BANS_INTERVAL{15}; | |||||
class CClientUIInterface; | class CClientUIInterface; | ||||
class CNetAddr; | class CNetAddr; | ||||
class CSubNet; | class CSubNet; | ||||
// Denial-of-service detection/prevention | // Denial-of-service detection/prevention | ||||
// The idea is to detect peers that are behaving | // The idea is to detect peers that are behaving | ||||
// badly and disconnect/ban them, but do it in a | // badly and disconnect/ban them, but do it in a | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |