forked from stellar/stellar-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBanManager.h
41 lines (30 loc) · 843 Bytes
/
BanManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
// Copyright 2016 Stellar Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
#include "xdr/Stellar-types.h"
/**
* Manages list of banned nodes.
*/
namespace stellar
{
class Application;
class Database;
class BanManager
{
public:
static std::unique_ptr<BanManager> create(Application& app);
static void dropAll(Database& db);
// Ban given node
virtual void banNode(NodeID nodeID) = 0;
// Unban given node
virtual void unbanNode(NodeID nodeID) = 0;
// Check if node is banned
virtual bool isBanned(NodeID nodeID) = 0;
// List banned nodes
virtual std::vector<std::string> getBans() = 0;
virtual ~BanManager()
{
}
};
}