mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
merge bitcoin#19192: Extract net permissions doc
This commit is contained in:
parent
54fb76f2f1
commit
8806c7baeb
@ -58,6 +58,7 @@
|
||||
#include <util/error.h>
|
||||
#include <util/moneystr.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
#include <util/system.h>
|
||||
#include <util/threadnames.h>
|
||||
#include <util/translation.h>
|
||||
@ -607,11 +608,7 @@ void SetupServerArgs(NodeContext& node)
|
||||
hidden_args.emplace_back("-natpmp");
|
||||
#endif // USE_NATPMP
|
||||
argsman.AddArg("-whitebind=<[permissions@]addr>", "Bind to given address and whitelist peers connecting to it. "
|
||||
"Use [host]:port notation for IPv6. Allowed permissions are bloomfilter (allow requesting BIP37 filtered blocks and transactions), "
|
||||
"noban (do not ban for misbehavior), "
|
||||
"forcerelay (relay transactions that are already in the mempool; implies relay), "
|
||||
"relay (relay even in -blocksonly mode), "
|
||||
"and mempool (allow requesting BIP35 mempool contents). "
|
||||
"Use [host]:port notation for IPv6. Allowed permissions: " + Join(NET_PERMISSIONS_DOC, ", ") + ". "
|
||||
"Specify multiple permissions separated by commas (default: noban,mempool,relay). Can be specified multiple times.", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
|
||||
argsman.AddArg("-whitelist=<[permissions@]IP address or network>", "Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or "
|
||||
|
@ -8,6 +8,14 @@
|
||||
#include <util/system.h>
|
||||
#include <util/translation.h>
|
||||
|
||||
const std::vector<std::string> NET_PERMISSIONS_DOC{
|
||||
"bloomfilter (allow requesting BIP37 filtered blocks and transactions)",
|
||||
"noban (do not ban for misbehavior)",
|
||||
"forcerelay (relay transactions that are already in the mempool; implies relay)",
|
||||
"relay (relay even in -blocksonly mode)",
|
||||
"mempool (allow requesting BIP35 mempool contents)",
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
||||
// Parse the following format: "perm1,perm2@xxxxxx"
|
||||
|
@ -2,15 +2,18 @@
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <netaddress.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <netaddress.h>
|
||||
|
||||
#ifndef BITCOIN_NET_PERMISSIONS_H
|
||||
#define BITCOIN_NET_PERMISSIONS_H
|
||||
|
||||
struct bilingual_str;
|
||||
|
||||
extern const std::vector<std::string> NET_PERMISSIONS_DOC;
|
||||
|
||||
enum NetPermissionFlags
|
||||
{
|
||||
PF_NONE = 0,
|
||||
@ -30,6 +33,7 @@ enum NetPermissionFlags
|
||||
PF_ISIMPLICIT = (1U << 31),
|
||||
PF_ALL = PF_BLOOMFILTER | PF_FORCERELAY | PF_RELAY | PF_NOBAN | PF_MEMPOOL,
|
||||
};
|
||||
|
||||
class NetPermissions
|
||||
{
|
||||
public:
|
||||
@ -48,6 +52,7 @@ public:
|
||||
flags = static_cast<NetPermissionFlags>(flags & ~f);
|
||||
}
|
||||
};
|
||||
|
||||
class NetWhitebindPermissions : public NetPermissions
|
||||
{
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user