PPCoin: Fix a startup issue loading blkindex since 90f58617
[novacoin.git] / src / protocol.h
index 009f67d..5943f8a 100644 (file)
 
 #include "serialize.h"
 #include <string>
+#include "uint256.h"
+
+#define PPCOIN_PORT  9901
+#define RPC_PORT     9902
+#define TESTNET_PORT 9903
 
 extern bool fTestNet;
+
 static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
 {
-    return testnet ? 18333 : 8333;
+    return testnet ? TESTNET_PORT : PPCOIN_PORT;
 }
 
 //
@@ -120,4 +126,30 @@ class CAddress
         unsigned int nLastTry;
 };
 
+class CInv
+{
+    public:
+        CInv();
+        CInv(int typeIn, const uint256& hashIn);
+        CInv(const std::string& strType, const uint256& hashIn);
+
+        IMPLEMENT_SERIALIZE
+        (
+            READWRITE(type);
+            READWRITE(hash);
+        )
+
+        friend bool operator<(const CInv& a, const CInv& b);
+
+        bool IsKnownType() const;
+        const char* GetCommand() const;
+        std::string ToString() const;
+        void print() const;
+
+    // TODO: make private (improves encapsulation)
+    public:
+        int type;
+        uint256 hash;
+};
+
 #endif // __INCLUDED_PROTOCOL_H__