mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Introduce enum ServiceFlags for service flags
This commit is contained in:
@@ -223,7 +223,9 @@ extern const char *FEEFILTER;
|
||||
const std::vector<std::string> &getAllNetMessageTypes();
|
||||
|
||||
/** nServices flags */
|
||||
enum {
|
||||
enum ServiceFlags : uint64_t {
|
||||
// Nothing
|
||||
NODE_NONE = 0,
|
||||
// NODE_NETWORK means that the node is capable of serving the block chain. It is currently
|
||||
// set by all Bitcoin Core nodes, and is unset by SPV clients or other peers that just want
|
||||
// network services but don't provide them.
|
||||
@@ -251,7 +253,7 @@ class CAddress : public CService
|
||||
{
|
||||
public:
|
||||
CAddress();
|
||||
explicit CAddress(CService ipIn, uint64_t nServicesIn);
|
||||
explicit CAddress(CService ipIn, ServiceFlags nServicesIn);
|
||||
|
||||
void Init();
|
||||
|
||||
@@ -267,13 +269,15 @@ public:
|
||||
if ((nType & SER_DISK) ||
|
||||
(nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH)))
|
||||
READWRITE(nTime);
|
||||
READWRITE(nServices);
|
||||
uint64_t nServicesInt = nServices;
|
||||
READWRITE(nServicesInt);
|
||||
nServices = (ServiceFlags)nServicesInt;
|
||||
READWRITE(*(CService*)this);
|
||||
}
|
||||
|
||||
// TODO: make private (improves encapsulation)
|
||||
public:
|
||||
uint64_t nServices;
|
||||
ServiceFlags nServices;
|
||||
|
||||
// disk and network only
|
||||
unsigned int nTime;
|
||||
|
||||
Reference in New Issue
Block a user