From 09dea9995a2d1dd210306d6a6d37576bf307a9a6 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 9 Dec 2011 14:46:22 -0800 Subject: [PATCH] Network status bitflags. --- NetworkStatus.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 NetworkStatus.h diff --git a/NetworkStatus.h b/NetworkStatus.h new file mode 100644 index 000000000..e50478349 --- /dev/null +++ b/NetworkStatus.h @@ -0,0 +1,26 @@ +#ifndef __NETWORKSTATUS__ +#define __NETWORKSTATUS__ + +struct NSBit +{ // a network status bit + const char *name, *description; + int number; +}; + +struct NetworkStatus +{ + static const int nsbConnected=0; // connected to the network + static const int nsbAccepted=1; // accept this as the real network + static const int nsbFastSynching=2; // catching up, skipping transactions + static const int nsbSlowSynching=3; // catching up, txn by txn + static const int nsbSynched=4; // in synch with the network + static const int nsbAnonymous=5; // hiding our identity + static const int nsbLedgerSync=6; // participating in ledger sync + static const int nsbStuck=7; // unable to sync + + static const int nnbCount=32; + std::bitset nsbValues; + std::map nsbData; +}; + +#endif