CScriptCheck : Add initializers
[novacoin.git] / src / main.h
index 29e33a7..b8e6cb7 100644 (file)
@@ -85,7 +85,7 @@ extern const string strMessageMagic;
 extern int64_t nTimeBestReceived;
 extern CCriticalSection cs_setpwalletRegistered;
 extern set<CWallet*> setpwalletRegistered;
-extern uint8_t pchMessageStart[4];
+extern uint32_t nNetworkID;
 extern map<uint256, CBlock*> mapOrphanBlocks;
 
 // Settings
@@ -732,10 +732,10 @@ class CScriptCheck
 {
 private:
     CScript scriptPubKey;
-    const CTransaction *ptxTo;
-    unsigned int nIn;
-    unsigned int nFlags;
-    int nHashType;
+    const CTransaction *ptxTo = nullptr;
+    unsigned int nIn = 0;
+    unsigned int nFlags = 0;
+    int nHashType = 0;
 
 public:
     CScriptCheck() {}
@@ -1068,7 +1068,7 @@ public:
 
         // Write index header
         unsigned int nSize = fileout.GetSerializeSize(*this);
-        fileout << FLATDATA(pchMessageStart) << nSize;
+        fileout << nNetworkID << nSize;
 
         // Write block
         long fileOutPos = ftell(fileout);
@@ -1644,12 +1644,12 @@ public:
         return mapTx.size();
     }
 
-    bool exists(uint256 hash)
+    bool exists(const uint256 &hash)
     {
         return (mapTx.count(hash) != 0);
     }
 
-    CTransaction& lookup(uint256 hash)
+    CTransaction& lookup(const uint256 &hash)
     {
         return mapTx[hash];
     }