mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
refactor: Remove addrdb.h dependency from node.h
This commit is contained in:
@@ -152,6 +152,7 @@ BITCOIN_CORE_H = \
|
|||||||
net.h \
|
net.h \
|
||||||
net_permissions.h \
|
net_permissions.h \
|
||||||
net_processing.h \
|
net_processing.h \
|
||||||
|
net_types.h \
|
||||||
netaddress.h \
|
netaddress.h \
|
||||||
netbase.h \
|
netbase.h \
|
||||||
netmessagemaker.h \
|
netmessagemaker.h \
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#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 <string>
|
#include <string>
|
||||||
@@ -79,8 +80,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <addrdb.h>
|
#include <addrdb.h>
|
||||||
#include <fs.h>
|
#include <fs.h>
|
||||||
|
#include <net_types.h> // For banmap_t
|
||||||
#include <sync.h>
|
#include <sync.h>
|
||||||
|
|
||||||
// NOTE: When adjusting this, update rpcnet:setban's help ("24h")
|
// NOTE: When adjusting this, update rpcnet:setban's help ("24h")
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
#ifndef BITCOIN_INTERFACES_NODE_H
|
#ifndef BITCOIN_INTERFACES_NODE_H
|
||||||
#define BITCOIN_INTERFACES_NODE_H
|
#define BITCOIN_INTERFACES_NODE_H
|
||||||
|
|
||||||
#include <addrdb.h> // For banmap_t
|
|
||||||
#include <amount.h> // For CAmount
|
#include <amount.h> // For CAmount
|
||||||
#include <net.h> // For CConnman::NumConnections
|
#include <net.h> // For CConnman::NumConnections
|
||||||
|
#include <net_types.h> // For banmap_t
|
||||||
#include <netaddress.h> // For Network
|
#include <netaddress.h> // For Network
|
||||||
#include <support/allocators/secure.h> // For SecureString
|
#include <support/allocators/secure.h> // For SecureString
|
||||||
|
|
||||||
|
|||||||
15
src/net_types.h
Normal file
15
src/net_types.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// Copyright (c) 2019 The Bitcoin Core developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#ifndef BITCOIN_NET_TYPES_H
|
||||||
|
#define BITCOIN_NET_TYPES_H
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
class CBanEntry;
|
||||||
|
class CSubNet;
|
||||||
|
|
||||||
|
using banmap_t = std::map<CSubNet, CBanEntry>;
|
||||||
|
|
||||||
|
#endif // BITCOIN_NET_TYPES_H
|
||||||
@@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
#include <qt/bantablemodel.h>
|
#include <qt/bantablemodel.h>
|
||||||
|
|
||||||
#include <qt/clientmodel.h>
|
|
||||||
|
|
||||||
#include <interfaces/node.h>
|
#include <interfaces/node.h>
|
||||||
|
#include <net_types.h> // For banmap_t
|
||||||
|
#include <qt/clientmodel.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,9 @@
|
|||||||
#include <clientversion.h>
|
#include <clientversion.h>
|
||||||
#include <core_io.h>
|
#include <core_io.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <net_processing.h>
|
|
||||||
#include <net_permissions.h>
|
#include <net_permissions.h>
|
||||||
|
#include <net_processing.h>
|
||||||
|
#include <net_types.h> // For banmap_t
|
||||||
#include <netbase.h>
|
#include <netbase.h>
|
||||||
#include <policy/settings.h>
|
#include <policy/settings.h>
|
||||||
#include <rpc/protocol.h>
|
#include <rpc/protocol.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user