aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-06-08 19:12:22 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-13 17:40:16 +0200
commitee06e04369c37da21e048fda849cce2a1f066f84 (patch)
treee38a64000268b4c41c00184b3d2f9da118bd98ce /src/protocol.h
parent15bf863219abe968ebe9e59fed4806c9fd07a58b (diff)
downloadbitcoin-ee06e04369c37da21e048fda849cce2a1f066f84.tar.xz
Introduce enum ServiceFlags for service flags
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/protocol.h b/src/protocol.h
index c3f819aaee..ab0a581783 100644
--- a/src/protocol.h
+++ b/src/protocol.h
@@ -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;