Changeset View
Changeset View
Standalone View
Standalone View
src/net_permissions.cpp
// Copyright (c) 2009-2018 The Bitcoin Core developers | // Copyright (c) 2009-2018 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. | ||||
#include <net_permissions.h> | #include <net_permissions.h> | ||||
#include <netbase.h> | #include <netbase.h> | ||||
#include <util/error.h> | #include <util/error.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/translation.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 { | namespace { | ||||
// The parse the following format "perm1,perm2@xxxxxx" | // The parse the following format "perm1,perm2@xxxxxx" | ||||
bool TryParsePermissionFlags(const std::string str, NetPermissionFlags &output, | bool TryParsePermissionFlags(const std::string str, NetPermissionFlags &output, | ||||
size_t &readen, bilingual_str &error) { | size_t &readen, bilingual_str &error) { | ||||
NetPermissionFlags flags = PF_NONE; | NetPermissionFlags flags = PF_NONE; | ||||
const auto atSeparator = str.find('@'); | const auto atSeparator = str.find('@'); | ||||
▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines |