Includes cleanup
authorsvost <ya.nowa@yandex.ru>
Thu, 10 Feb 2022 14:37:06 +0000 (17:37 +0300)
committersvost <ya.nowa@yandex.ru>
Thu, 10 Feb 2022 14:37:06 +0000 (17:37 +0300)
15 files changed:
src/bitcoinrpc.h
src/checkpoints.cpp
src/checkpoints.h
src/db.cpp
src/db.h
src/kernel.cpp
src/kernel.h
src/kernel_worker.cpp
src/kernel_worker.h
src/main.cpp
src/main.h
src/miner.cpp
src/noui.cpp
src/txdb-leveldb.cpp
src/txdb-leveldb.h

index d0a3712..7c5bd87 100644 (file)
@@ -6,18 +6,15 @@
 #ifndef _BITCOINRPC_H_
 #define _BITCOINRPC_H_ 1
 
-#include <string>
-#include <list>
-#include <map>
-
-class CBlockIndex;
+#include "checkpoints.h"
 
 #include "json/json_spirit_reader_template.h"
 #include "json/json_spirit_writer_template.h"
 #include "json/json_spirit_utils.h"
 
-#include "util.h"
-#include "checkpoints.h"
+#include <string>
+#include <list>
+#include <map>
 
 // HTTP status codes
 enum HTTPStatusCode
index 396fb24..ab3c7f7 100644 (file)
@@ -5,7 +5,6 @@
 #include "checkpoints.h"
 #include "main.h"
 #include "txdb-leveldb.h"
-#include "uint256.h"
 
 #include <algorithm>
 
@@ -383,6 +382,40 @@ const std::string CSyncCheckpoint::strMasterPubKey = "04a51b735f816de4ec3f891d5b
 std::string CSyncCheckpoint::strMasterPrivKey = "";
 
 // ppcoin: verify signature of sync-checkpoint message
+CSyncCheckpoint::CSyncCheckpoint()
+{
+    SetNull();
+}
+
+void CSyncCheckpoint::SetNull()
+{
+    CUnsignedSyncCheckpoint::SetNull();
+    vchMsg.clear();
+    vchSig.clear();
+}
+
+bool CSyncCheckpoint::IsNull() const
+{
+    return (hashCheckpoint == 0);
+}
+
+uint256 CSyncCheckpoint::GetHash() const
+{
+    return SerializeHash(*this);
+}
+
+bool CSyncCheckpoint::RelayTo(CNode *pnode) const
+{
+    // returns true if wasn't already sent
+    if (pnode->hashCheckpointKnown != hashCheckpoint)
+    {
+        pnode->hashCheckpointKnown = hashCheckpoint;
+        pnode->PushMessage("checkpoint", *this);
+        return true;
+    }
+    return false;
+}
+
 bool CSyncCheckpoint::CheckSignature()
 {
     CPubKey key(ParseHex(CSyncCheckpoint::strMasterPubKey));
index a2b9731..701e253 100644 (file)
@@ -4,9 +4,11 @@
 #ifndef BITCOIN_CHECKPOINT_H
 #define  BITCOIN_CHECKPOINT_H
 
-#include <map>
 #include "util.h"
-#include "net.h"
+#include "sync.h"
+#include "uint256.h"
+
+#include <map>
 
 // max 1 hour before latest block
 static const int64_t CHECKPOINT_MAX_SPAN = nOneHour;
@@ -17,9 +19,9 @@ static const int64_t CHECKPOINT_MAX_SPAN = nOneHour;
 #undef ADVISORY
 #endif
 
-class uint256;
 class CBlockIndex;
 class CSyncCheckpoint;
+class CNode;
 
 /** Block-chain checkpoints are compiled-in sanity checks.
  * They are updated every release or three.
@@ -111,10 +113,7 @@ public:
     std::vector<unsigned char> vchMsg;
     std::vector<unsigned char> vchSig;
 
-    CSyncCheckpoint()
-    {
-        SetNull();
-    }
+    CSyncCheckpoint();
 
     IMPLEMENT_SERIALIZE
     (
@@ -122,35 +121,10 @@ public:
         READWRITE(vchSig);
     )
 
-    void SetNull()
-    {
-        CUnsignedSyncCheckpoint::SetNull();
-        vchMsg.clear();
-        vchSig.clear();
-    }
-
-    bool IsNull() const
-    {
-        return (hashCheckpoint == 0);
-    }
-
-    uint256 GetHash() const
-    {
-        return SerializeHash(*this);
-    }
-
-    bool RelayTo(CNode* pnode) const
-    {
-        // returns true if wasn't already sent
-        if (pnode->hashCheckpointKnown != hashCheckpoint)
-        {
-            pnode->hashCheckpointKnown = hashCheckpoint;
-            pnode->PushMessage("checkpoint", *this);
-            return true;
-        }
-        return false;
-    }
-
+    void SetNull();
+    bool IsNull() const;
+    uint256 GetHash() const;
+    bool RelayTo(CNode* pnode) const;
     bool CheckSignature();
     bool ProcessSyncCheckpoint(CNode* pfrom);
 };
index cc1f3e9..946454d 100644 (file)
@@ -4,10 +4,9 @@
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
 #include "db.h"
-#include "net.h"
 #include "util.h"
 #include "main.h"
-#include "interface.h"
+
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 
index 07bb2b0..2cccbc6 100644 (file)
--- a/src/db.h
+++ b/src/db.h
@@ -5,7 +5,11 @@
 #ifndef BITCOIN_DB_H
 #define BITCOIN_DB_H
 
-#include "main.h"
+#include "sync.h"
+#include "serialize.h"
+#include "script.h"
+
+#include <boost/filesystem/path.hpp>
 
 #include <map>
 #include <string>
index a2a0e0e..639547c 100644 (file)
@@ -6,10 +6,10 @@
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
 #include "kernel.h"
+#include "wallet.h"
 #include "kernel_worker.h"
 #include "txdb-leveldb.h"
 
-extern unsigned int nStakeMaxAge;
 extern unsigned int nStakeTargetSpacing;
 
 using namespace std;
index 464e401..e41b9a4 100644 (file)
@@ -5,7 +5,8 @@
 #define PPCOIN_KERNEL_H
 
 #include "main.h"
-#include "wallet.h"
+
+extern unsigned int nStakeMaxAge;
 
 // ChainDB upgrade time
 extern unsigned int nModifierUpgradeTime;
@@ -56,4 +57,4 @@ inline int64_t GetWeight(int64_t nIntervalBeginning, int64_t nIntervalEnd)
     return std::min(nIntervalEnd - nIntervalBeginning - nStakeMinAge, (int64_t)nStakeMaxAge);
 }
 
-#endif // PPCOIN_KERNEL_H
\ No newline at end of file
+#endif // PPCOIN_KERNEL_H
index 244769b..1c66963 100644 (file)
@@ -1,8 +1,5 @@
-#include <vector>
-#include <inttypes.h>
 
 #include "uint256.h"
-#include "bignum.h"
 #include "kernel.h"
 #include "kernel_worker.h"
 
index 93ee62c..594ab35 100644 (file)
@@ -1,8 +1,13 @@
 #ifndef NOVACOIN_KERNELWORKER_H
 #define NOVACOIN_KERNELWORKER_H
 
+#include "bignum.h"
+
+#include <cstdint>
 #include <vector>
 
+class uint256;
+
 class KernelWorker
 {
 public:
@@ -33,4 +38,4 @@ private:
 // Scan given kernel for solutions
 bool ScanKernelBackward(unsigned char *kernel, uint32_t nBits, uint32_t nInputTxTime, int64_t nValueIn, std::pair<uint32_t, uint32_t> &SearchInterval, std::pair<uint256, uint32_t> &solution);
 
-#endif // NOVACOIN_KERNELWORKER_H
\ No newline at end of file
+#endif // NOVACOIN_KERNELWORKER_H
index 7925ce1..8cf70d1 100644 (file)
@@ -3,6 +3,7 @@
 // Distributed under the MIT/X11 software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
+#include "main.h"
 #include "alert.h"
 #include "checkpoints.h"
 #include "db.h"
 #include "interface.h"
 #include "checkqueue.h"
 #include "kernel.h"
+
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 
-#include "main.h"
-
 #include <regex>
 
 using namespace std;
index b75dd8d..b3bff19 100644 (file)
@@ -5,14 +5,13 @@
 #ifndef BITCOIN_MAIN_H
 #define BITCOIN_MAIN_H
 
-#include <algorithm>
-
 #include "timestamps.h"
 #include "sync.h"
 #include "net.h"
 #include "script.h"
 #include "scrypt.h"
 
+#include <algorithm>
 #include <limits>
 #include <list>
 #include <map>
index 4818e4c..d4a2cab 100644 (file)
@@ -8,6 +8,7 @@
 #include "miner.h"
 #include "kernel.h"
 #include "kernel_worker.h"
+#include "wallet.h"
 
 
 //////////////////////////////////////////////////////////////////////////////
index 91fb8d0..8643715 100644 (file)
@@ -2,9 +2,8 @@
 // Copyright (c) 2009-2012 The Bitcoin developers
 // Distributed under the MIT/X11 software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
 #include "interface.h"
-#include "init.h"
-#include "bitcoinrpc.h"
 
 #include <string>
 
index a6282e8..5ccf07d 100644 (file)
@@ -3,7 +3,9 @@
 // Distributed under the MIT/X11 software license, see the accompanying
 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
 
-#include <map>
+#include "txdb-leveldb.h"
+#include "kernel.h"
+#include "checkpoints.h"
 
 #include <boost/version.hpp>
 #include <boost/filesystem.hpp>
 #include <leveldb/filter_policy.h>
 #include <memenv/memenv.h>
 
-#include "kernel.h"
-#include "checkpoints.h"
-#include "txdb-leveldb.h"
-#include "util.h"
-#include "main.h"
-
 using namespace std;
 
 leveldb::DB *txdb; // global pointer for LevelDB object instance
index 07c7088..8f0c995 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef BITCOIN_LEVELDB_H
 #define BITCOIN_LEVELDB_H
 
-#include "main.h"
+#include "serialize.h"
 
 #include <map>
 #include <string>
 #include <leveldb/db.h>
 #include <leveldb/write_batch.h>
 
+class CBigNum;
+class CDiskBlockIndex;
+class COutPoint;
+class CTxIndex;
+class CTransaction;
+class uint256;
+class CDiskTxPos;
+
 // Class that provides access to a LevelDB. Note that this class is frequently
 // instantiated on the stack and then destroyed again, so instantiation has to
 // be very cheap. Unfortunately that means, a CTxDB instance is actually just a