Changeset View
Changeset View
Standalone View
Standalone View
src/net_permissions.h
Show All 29 Lines | enum NetPermissionFlags { | ||||
PF_DOWNLOAD = (1U << 6), | PF_DOWNLOAD = (1U << 6), | ||||
// Can't be banned/disconnected/discouraged for misbehavior | // Can't be banned/disconnected/discouraged for misbehavior | ||||
PF_NOBAN = (1U << 4) | PF_DOWNLOAD, | PF_NOBAN = (1U << 4) | PF_DOWNLOAD, | ||||
// Can query the mempool | // Can query the mempool | ||||
PF_MEMPOOL = (1U << 5), | PF_MEMPOOL = (1U << 5), | ||||
// Can request addrs without hitting a privacy-preserving cache, and send us | // Can request addrs without hitting a privacy-preserving cache, and send us | ||||
// unlimited amounts of addrs. | // unlimited amounts of addrs. | ||||
PF_ADDR = (1U << 7), | PF_ADDR = (1U << 7), | ||||
// Can send compact proofs via avaproofs messages without being requested | |||||
PF_CMPCTPROOFS = (1U << 29), | |||||
// Bypass the limit on how many proof INVs are tracked from this peer as | // Bypass the limit on how many proof INVs are tracked from this peer as | ||||
// well as the delay penalty when reaching the the in-flight requests limit | // well as the delay penalty when reaching the the in-flight requests limit | ||||
PF_BYPASS_PROOF_REQUEST_LIMITS = (1U << 30), | PF_BYPASS_PROOF_REQUEST_LIMITS = (1U << 30), | ||||
// True if the user did not specifically set fine grained permissions | // True if the user did not specifically set fine grained permissions | ||||
PF_ISIMPLICIT = (1U << 31), | PF_ISIMPLICIT = (1U << 31), | ||||
PF_ALL = PF_BLOOMFILTER | PF_FORCERELAY | PF_RELAY | PF_NOBAN | PF_MEMPOOL | | PF_ALL = PF_BLOOMFILTER | PF_FORCERELAY | PF_RELAY | PF_NOBAN | PF_MEMPOOL | | ||||
PF_DOWNLOAD | PF_BYPASS_PROOF_REQUEST_LIMITS | PF_ADDR, | PF_DOWNLOAD | PF_ADDR | PF_CMPCTPROOFS | | ||||
PF_BYPASS_PROOF_REQUEST_LIMITS, | |||||
}; | }; | ||||
class NetPermissions { | class NetPermissions { | ||||
public: | public: | ||||
NetPermissionFlags m_flags; | NetPermissionFlags m_flags; | ||||
static std::vector<std::string> ToStrings(NetPermissionFlags flags); | static std::vector<std::string> ToStrings(NetPermissionFlags flags); | ||||
static inline bool HasFlag(const NetPermissionFlags &flags, | static inline bool HasFlag(const NetPermissionFlags &flags, | ||||
NetPermissionFlags f) { | NetPermissionFlags f) { | ||||
Show All 27 Lines |