Browse Source

Cleanup code using forward declarations.

Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
pull/1/head
Brandon Dahler 9 years ago
parent
commit
51ed9ec971
  1. 2
      configure.ac
  2. 7
      share/qt/extract_strings_qt.py
  3. 2
      src/Makefile.am
  4. 36
      src/addrman.cpp
  5. 33
      src/addrman.h
  6. 21
      src/alert.cpp
  7. 17
      src/alert.h
  8. 7
      src/allocators.h
  9. 15
      src/base58.h
  10. 39
      src/bignum.h
  11. 2
      src/bitcoin-cli.cpp
  12. 12
      src/bitcoind.cpp
  13. 27
      src/bitcoinrpc.cpp
  14. 21
      src/bitcoinrpc.h
  15. 6
      src/bloom.cpp
  16. 7
      src/bloom.h
  17. 6
      src/chainparams.cpp
  18. 1
      src/chainparams.h
  19. 14
      src/checkpoints.cpp
  20. 3
      src/checkpoints.h
  21. 11
      src/checkqueue.h
  22. 20
      src/compat.h
  23. 13
      src/core.cpp
  24. 31
      src/core.h
  25. 9
      src/crypter.cpp
  26. 6
      src/crypter.h
  27. 23
      src/db.cpp
  28. 9
      src/db.h
  29. 9
      src/hash.h
  30. 45
      src/init.cpp
  31. 6
      src/init.h
  32. 7
      src/key.cpp
  33. 8
      src/key.h
  34. 5
      src/keystore.cpp
  35. 6
      src/keystore.h
  36. 6
      src/leveldbwrapper.cpp
  37. 4
      src/leveldbwrapper.h
  38. 2
      src/limitedmap.h
  39. 152
      src/main.cpp
  40. 83
      src/main.h
  41. 32
      src/miner.cpp
  42. 13
      src/miner.h
  43. 4
      src/mruset.h
  44. 62
      src/net.cpp
  45. 107
      src/net.h
  46. 14
      src/netbase.cpp
  47. 10
      src/netbase.h
  48. 8
      src/noui.cpp
  49. 10
      src/noui.h
  50. 6
      src/protocol.cpp
  51. 12
      src/protocol.h
  52. 1
      src/qt/aboutdialog.cpp
  53. 3
      src/qt/aboutdialog.h
  54. 8
      src/qt/addressbookpage.cpp
  55. 8
      src/qt/addressbookpage.h
  56. 2
      src/qt/addresstablemodel.cpp
  57. 3
      src/qt/addresstablemodel.h
  58. 4
      src/qt/askpassphrasedialog.cpp
  59. 3
      src/qt/askpassphrasedialog.h
  60. 33
      src/qt/bitcoin.cpp
  61. 5
      src/qt/bitcoinamountfield.cpp
  62. 49
      src/qt/bitcoingui.cpp
  63. 20
      src/qt/bitcoingui.h
  64. 5
      src/qt/bitcoinstrings.cpp
  65. 2
      src/qt/bitcoinunits.h
  66. 14
      src/qt/clientmodel.cpp
  67. 3
      src/qt/clientmodel.h
  68. 2
      src/qt/csvmodelwriter.h
  69. 3
      src/qt/editaddressdialog.h
  70. 53
      src/qt/guiutil.cpp
  71. 10
      src/qt/guiutil.h
  72. 10
      src/qt/intro.cpp
  73. 5
      src/qt/intro.h
  74. 4
      src/qt/macdockiconhandler.h
  75. 1
      src/qt/macnotificationhandler.h
  76. 2
      src/qt/monitoreddatamapper.cpp
  77. 24
      src/qt/notificator.cpp
  78. 3
      src/qt/notificator.h
  79. 3
      src/qt/optionsdialog.cpp
  80. 7
      src/qt/optionsdialog.h
  81. 14
      src/qt/optionsmodel.cpp
  82. 10
      src/qt/overviewpage.cpp
  83. 9
      src/qt/overviewpage.h
  84. 12
      src/qt/paymentrequestplus.cpp
  85. 7
      src/qt/paymentrequestplus.h
  86. 44
      src/qt/paymentserver.cpp
  87. 10
      src/qt/paymentserver.h
  88. 14
      src/qt/rpcconsole.cpp
  89. 3
      src/qt/rpcconsole.h
  90. 9
      src/qt/sendcoinsdialog.cpp
  91. 10
      src/qt/sendcoinsdialog.h
  92. 7
      src/qt/sendcoinsentry.cpp
  93. 5
      src/qt/sendcoinsentry.h
  94. 11
      src/qt/signverifymessagedialog.cpp
  95. 3
      src/qt/signverifymessagedialog.h
  96. 3
      src/qt/splashscreen.cpp
  97. 18
      src/qt/test/paymentservertests.cpp
  98. 6
      src/qt/test/paymentservertests.h
  99. 8
      src/qt/test/test_main.cpp
  100. 5
      src/qt/test/uritests.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

2
configure.ac

@ -151,7 +151,7 @@ PKG_PROG_PKG_CONFIG @@ -151,7 +151,7 @@ PKG_PROG_PKG_CONFIG
## compatibility with the legacy buildsystem.
##
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter"
CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO"
CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
AC_LANG_PUSH([C++])

7
share/qt/extract_strings_qt.py

@ -57,7 +57,10 @@ child = Popen([XGETTEXT,'--output=-','-n','--keyword=_'] + files, stdout=PIPE) @@ -57,7 +57,10 @@ child = Popen([XGETTEXT,'--output=-','-n','--keyword=_'] + files, stdout=PIPE)
messages = parse_po(out)
f = open(OUT_CPP, 'w')
f.write("""#include <QtGlobal>
f.write("""
#include <QtGlobal>
// Automatically generated by extract_strings.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
@ -70,5 +73,5 @@ messages.sort(key=operator.itemgetter(0)) @@ -70,5 +73,5 @@ messages.sort(key=operator.itemgetter(0))
for (msgid, msgstr) in messages:
if msgid != EMPTY:
f.write('QT_TRANSLATE_NOOP("bitcoin-core", %s),\n' % ('\n'.join(msgid)))
f.write('};')
f.write('};\n')
f.close()

2
src/Makefile.am

@ -16,7 +16,7 @@ BITCOIN_CORE_H = addrman.h alert.h allocators.h base58.h bignum.h \ @@ -16,7 +16,7 @@ BITCOIN_CORE_H = addrman.h alert.h allocators.h base58.h bignum.h \
bitcoinrpc.h bloom.h chainparams.h checkpoints.h checkqueue.h \
clientversion.h compat.h core.h crypter.h db.h hash.h init.h \
key.h keystore.h leveldbwrapper.h limitedmap.h main.h miner.h mruset.h \
netbase.h net.h protocol.h script.h serialize.h sync.h threadsafety.h \
netbase.h net.h noui.h protocol.h script.h serialize.h sync.h threadsafety.h \
txdb.h txmempool.h ui_interface.h uint256.h util.h version.h walletdb.h wallet.h
JSON_H = json/json_spirit.h json/json_spirit_error_position.h \

36
src/addrman.cpp

@ -3,7 +3,9 @@ @@ -3,7 +3,9 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "addrman.h"
#include "hash.h"
#include "serialize.h"
using namespace std;
@ -12,12 +14,12 @@ int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const @@ -12,12 +14,12 @@ int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
CDataStream ss1(SER_GETHASH, 0);
std::vector<unsigned char> vchKey = GetKey();
ss1 << nKey << vchKey;
uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64();
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDataStream ss2(SER_GETHASH, 0);
std::vector<unsigned char> vchGroupKey = GetGroup();
ss2 << nKey << vchGroupKey << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP);
uint64 hash2 = Hash(ss2.begin(), ss2.end()).Get64();
uint64_t hash2 = Hash(ss2.begin(), ss2.end()).Get64();
return hash2 % ADDRMAN_TRIED_BUCKET_COUNT;
}
@ -27,15 +29,15 @@ int CAddrInfo::GetNewBucket(const std::vector<unsigned char> &nKey, const CNetAd @@ -27,15 +29,15 @@ int CAddrInfo::GetNewBucket(const std::vector<unsigned char> &nKey, const CNetAd
std::vector<unsigned char> vchGroupKey = GetGroup();
std::vector<unsigned char> vchSourceGroupKey = src.GetGroup();
ss1 << nKey << vchGroupKey << vchSourceGroupKey;
uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64();
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDataStream ss2(SER_GETHASH, 0);
ss2 << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP);
uint64 hash2 = Hash(ss2.begin(), ss2.end()).Get64();
uint64_t hash2 = Hash(ss2.begin(), ss2.end()).Get64();
return hash2 % ADDRMAN_NEW_BUCKET_COUNT;
}
bool CAddrInfo::IsTerrible(int64 nNow) const
bool CAddrInfo::IsTerrible(int64_t nNow) const
{
if (nLastTry && nLastTry >= nNow-60) // never remove things tried the last minute
return false;
@ -55,12 +57,12 @@ bool CAddrInfo::IsTerrible(int64 nNow) const @@ -55,12 +57,12 @@ bool CAddrInfo::IsTerrible(int64 nNow) const
return false;
}
double CAddrInfo::GetChance(int64 nNow) const
double CAddrInfo::GetChance(int64_t nNow) const
{
double fChance = 1.0;
int64 nSinceLastSeen = nNow - nTime;
int64 nSinceLastTry = nNow - nLastTry;
int64_t nSinceLastSeen = nNow - nTime;
int64_t nSinceLastTry = nNow - nLastTry;
if (nSinceLastSeen < 0) nSinceLastSeen = 0;
if (nSinceLastTry < 0) nSinceLastTry = 0;
@ -129,7 +131,7 @@ int CAddrMan::SelectTried(int nKBucket) @@ -129,7 +131,7 @@ int CAddrMan::SelectTried(int nKBucket)
// random shuffle the first few elements (using the entire list)
// find the least recently tried among them
int64 nOldest = -1;
int64_t nOldest = -1;
int nOldestPos = -1;
for (unsigned int i = 0; i < ADDRMAN_TRIED_ENTRIES_INSPECT_ON_EVICT && i < vTried.size(); i++)
{
@ -259,7 +261,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin) @@ -259,7 +261,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin)
return;
}
void CAddrMan::Good_(const CService &addr, int64 nTime)
void CAddrMan::Good_(const CService &addr, int64_t nTime)
{
int nId;
CAddrInfo *pinfo = Find(addr, &nId);
@ -308,7 +310,7 @@ void CAddrMan::Good_(const CService &addr, int64 nTime) @@ -308,7 +310,7 @@ void CAddrMan::Good_(const CService &addr, int64 nTime)
MakeTried(info, nId, nUBucket);
}
bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePenalty)
bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty)
{
if (!addr.IsRoutable())
return false;
@ -321,9 +323,9 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePen @@ -321,9 +323,9 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePen
{
// periodically update nTime
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);
int64 nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60);
int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60);
if (addr.nTime && (!pinfo->nTime || pinfo->nTime < addr.nTime - nUpdateInterval - nTimePenalty))
pinfo->nTime = max((int64)0, addr.nTime - nTimePenalty);
pinfo->nTime = max((int64_t)0, addr.nTime - nTimePenalty);
// add services
pinfo->nServices |= addr.nServices;
@ -348,7 +350,7 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePen @@ -348,7 +350,7 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePen
return false;
} else {
pinfo = Create(addr, source, &nId);
pinfo->nTime = max((int64)0, (int64)pinfo->nTime - nTimePenalty);
pinfo->nTime = max((int64_t)0, (int64_t)pinfo->nTime - nTimePenalty);
nNew++;
fNew = true;
}
@ -365,7 +367,7 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePen @@ -365,7 +367,7 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePen
return fNew;
}
void CAddrMan::Attempt_(const CService &addr, int64 nTime)
void CAddrMan::Attempt_(const CService &addr, int64_t nTime)
{
CAddrInfo *pinfo = Find(addr);
@ -504,7 +506,7 @@ void CAddrMan::GetAddr_(std::vector<CAddress> &vAddr) @@ -504,7 +506,7 @@ void CAddrMan::GetAddr_(std::vector<CAddress> &vAddr)
}
}
void CAddrMan::Connected_(const CService &addr, int64 nTime)
void CAddrMan::Connected_(const CService &addr, int64_t nTime)
{
CAddrInfo *pinfo = Find(addr);
@ -519,7 +521,7 @@ void CAddrMan::Connected_(const CService &addr, int64 nTime) @@ -519,7 +521,7 @@ void CAddrMan::Connected_(const CService &addr, int64 nTime)
return;
// update info
int64 nUpdateInterval = 20 * 60;
int64_t nUpdateInterval = 20 * 60;
if (nTime - info.nTime > nUpdateInterval)
info.nTime = nTime;
}

33
src/addrman.h

@ -1,21 +1,22 @@ @@ -1,21 +1,22 @@
// Copyright (c) 2012 Pieter Wuille
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef _BITCOIN_ADDRMAN
#define _BITCOIN_ADDRMAN 1
#include "netbase.h"
#include "protocol.h"
#include "util.h"
#include "sync.h"
#include "util.h"
#include <map>
#include <set>
#include <stdint.h>
#include <vector>
#include <openssl/rand.h>
/** Extended statistics about a CAddress */
class CAddrInfo : public CAddress
{
@ -24,10 +25,10 @@ private: @@ -24,10 +25,10 @@ private:
CNetAddr source;
// last successful connection by us
int64 nLastSuccess;
int64_t nLastSuccess;
// last try whatsoever by us:
// int64 CAddress::nLastTry
// int64_t CAddress::nLastTry
// connection attempts since last successful attempt
int nAttempts;
@ -86,10 +87,10 @@ public: @@ -86,10 +87,10 @@ public:
}
// Determine whether the statistics about this entry are bad enough so that it can just be deleted
bool IsTerrible(int64 nNow = GetAdjustedTime()) const;
bool IsTerrible(int64_t nNow = GetAdjustedTime()) const;
// Calculate the relative chance this entry should be given when selecting nodes to connect to
double GetChance(int64 nNow = GetAdjustedTime()) const;
double GetChance(int64_t nNow = GetAdjustedTime()) const;
};
@ -220,13 +221,13 @@ protected: @@ -220,13 +221,13 @@ protected:
void MakeTried(CAddrInfo& info, int nId, int nOrigin);
// Mark an entry "good", possibly moving it from "new" to "tried".
void Good_(const CService &addr, int64 nTime);
void Good_(const CService &addr, int64_t nTime);
// Add an entry to the "new" table.
bool Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePenalty);
bool Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty);
// Mark an entry as attempted to connect.
void Attempt_(const CService &addr, int64 nTime);
void Attempt_(const CService &addr, int64_t nTime);
// Select an address to connect to.
// nUnkBias determines how much to favor new addresses over tried ones (min=0, max=100)
@ -241,7 +242,7 @@ protected: @@ -241,7 +242,7 @@ protected:
void GetAddr_(std::vector<CAddress> &vAddr);
// Mark an entry as currently-connected-to.
void Connected_(const CService &addr, int64 nTime);
void Connected_(const CService &addr, int64_t nTime);
public:
@ -409,7 +410,7 @@ public: @@ -409,7 +410,7 @@ public:
}
// Add a single address.
bool Add(const CAddress &addr, const CNetAddr& source, int64 nTimePenalty = 0)
bool Add(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty = 0)
{
bool fRet = false;
{
@ -424,7 +425,7 @@ public: @@ -424,7 +425,7 @@ public:
}
// Add multiple addresses.
bool Add(const std::vector<CAddress> &vAddr, const CNetAddr& source, int64 nTimePenalty = 0)
bool Add(const std::vector<CAddress> &vAddr, const CNetAddr& source, int64_t nTimePenalty = 0)
{
int nAdd = 0;
{
@ -440,7 +441,7 @@ public: @@ -440,7 +441,7 @@ public:
}
// Mark an entry as accessible.
void Good(const CService &addr, int64 nTime = GetAdjustedTime())
void Good(const CService &addr, int64_t nTime = GetAdjustedTime())
{
{
LOCK(cs);
@ -451,7 +452,7 @@ public: @@ -451,7 +452,7 @@ public:
}
// Mark an entry as connection attempted to.
void Attempt(const CService &addr, int64 nTime = GetAdjustedTime())
void Attempt(const CService &addr, int64_t nTime = GetAdjustedTime())
{
{
LOCK(cs);
@ -489,7 +490,7 @@ public: @@ -489,7 +490,7 @@ public:
}
// Mark an entry as currently-connected-to.
void Connected(const CService &addr, int64 nTime = GetAdjustedTime())
void Connected(const CService &addr, int64_t nTime = GetAdjustedTime())
{
{
LOCK(cs);

21
src/alert.cpp

@ -2,17 +2,20 @@ @@ -2,17 +2,20 @@
// Alert system
//
#include <algorithm>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/foreach.hpp>
#include <map>
#include "alert.h"
#include "key.h"
#include "net.h"
#include "sync.h"
#include "ui_interface.h"
#include "util.h"
#include <algorithm>
#include <inttypes.h>
#include <map>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/foreach.hpp>
using namespace std;
@ -48,8 +51,8 @@ std::string CUnsignedAlert::ToString() const @@ -48,8 +51,8 @@ std::string CUnsignedAlert::ToString() const
return strprintf(
"CAlert(\n"
" nVersion = %d\n"
" nRelayUntil = %"PRI64d"\n"
" nExpiration = %"PRI64d"\n"
" nRelayUntil = %"PRId64"\n"
" nExpiration = %"PRId64"\n"
" nID = %d\n"
" nCancel = %d\n"
" setCancel = %s\n"

17
src/alert.h

@ -6,13 +6,20 @@ @@ -6,13 +6,20 @@
#ifndef _BITCOINALERT_H_
#define _BITCOINALERT_H_ 1
#include "serialize.h"
#include "sync.h"
#include <map>
#include <set>
#include <stdint.h>
#include <string>
#include "uint256.h"
#include "util.h"
class CAlert;
class CNode;
class uint256;
extern std::map<uint256, CAlert> mapAlerts;
extern CCriticalSection cs_mapAlerts;
/** Alerts are for notifying old versions if they become too obsolete and
* need to upgrade. The message is displayed in the status bar.
@ -24,8 +31,8 @@ class CUnsignedAlert @@ -24,8 +31,8 @@ class CUnsignedAlert
{
public:
int nVersion;
int64 nRelayUntil; // when newer nodes stop relaying to newer nodes
int64 nExpiration;
int64_t nRelayUntil; // when newer nodes stop relaying to newer nodes
int64_t nExpiration;
int nID;
int nCancel;
std::set<int> setCancel;

7
src/allocators.h

@ -2,17 +2,18 @@ @@ -2,17 +2,18 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_ALLOCATORS_H
#define BITCOIN_ALLOCATORS_H
#include <string.h>
#include <map>
#include <string>
#include <string.h>
#include <boost/thread/mutex.hpp>
#include <boost/thread/once.hpp>
#include <map>
#include <openssl/crypto.h> // for OPENSSL_cleanse()
/**
* Thread-safe class to keep track of locked (ie, non-swappable) memory pages.
*

15
src/base58.h

@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//
// Why base-58 instead of standard base-64 encoding?
// - Don't want 0OIl characters that look the same in some fonts and
@ -15,14 +14,18 @@ @@ -15,14 +14,18 @@
#ifndef BITCOIN_BASE58_H
#define BITCOIN_BASE58_H
#include <string>
#include <vector>
#include "chainparams.h"
#include "bignum.h"
#include "chainparams.h"
#include "hash.h"
#include "key.h"
#include "script.h"
#include "allocators.h"
#include "uint256.h"
#include <string>
#include <vector>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

39
src/bignum.h

@ -2,14 +2,19 @@ @@ -2,14 +2,19 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_BIGNUM_H
#define BITCOIN_BIGNUM_H
#include "serialize.h"
#include "uint256.h"
#include "version.h"
#include <stdexcept>
#include <stdint.h>
#include <vector>
#include <openssl/bn.h>
#include "util.h" // for uint64
#include <openssl/bn.h>
/** Errors thrown by the bignum class */
class bignum_error : public std::runtime_error
@ -79,17 +84,17 @@ public: @@ -79,17 +84,17 @@ public:
}
//CBigNum(char n) is not portable. Use 'signed char' or 'unsigned char'.
CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(int64 n) { BN_init(this); setint64(n); }
CBigNum(unsigned char n) { BN_init(this); setulong(n); }
CBigNum(unsigned short n) { BN_init(this); setulong(n); }
CBigNum(unsigned int n) { BN_init(this); setulong(n); }
CBigNum(unsigned long n) { BN_init(this); setulong(n); }
CBigNum(uint64 n) { BN_init(this); setuint64(n); }
explicit CBigNum(uint256 n) { BN_init(this); setuint256(n); }
CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(long long n) { BN_init(this); setint64(n); }
CBigNum(unsigned char n) { BN_init(this); setulong(n); }
CBigNum(unsigned short n) { BN_init(this); setulong(n); }
CBigNum(unsigned int n) { BN_init(this); setulong(n); }
CBigNum(unsigned long n) { BN_init(this); setulong(n); }
CBigNum(unsigned long long n) { BN_init(this); setuint64(n); }
explicit CBigNum(uint256 n) { BN_init(this); setuint256(n); }
explicit CBigNum(const std::vector<unsigned char>& vch)
{
@ -122,14 +127,14 @@ public: @@ -122,14 +127,14 @@ public:
return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n);
}
void setint64(int64 sn)
void setint64(int64_t sn)
{
unsigned char pch[sizeof(sn) + 6];
unsigned char* p = pch + 4;
bool fNegative;
uint64 n;
uint64_t n;
if (sn < (int64)0)
if (sn < (int64_t)0)
{
// Since the minimum signed integer cannot be represented as positive so long as its type is signed,
// and it's not well-defined what happens if you make it unsigned before negating it,
@ -167,7 +172,7 @@ public: @@ -167,7 +172,7 @@ public:
BN_mpi2bn(pch, p - pch, this);
}
void setuint64(uint64 n)
void setuint64(uint64_t n)
{
unsigned char pch[sizeof(n) + 6];
unsigned char* p = pch + 4;

2
src/bitcoin-cli.cpp

@ -8,6 +8,8 @@ @@ -8,6 +8,8 @@
#include "bitcoinrpc.h"
#include "ui_interface.h" /* for _(...) */
#include <boost/filesystem/operations.hpp>
//////////////////////////////////////////////////////////////////////////////
//
// Start

12
src/bitcoind.cpp

@ -3,12 +3,17 @@ @@ -3,12 +3,17 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "ui_interface.h"
#include "bitcoinrpc.h"
#include "init.h"
#include "util.h"
#include "main.h"
#include "bitcoinrpc.h"
#include "noui.h"
#include "ui_interface.h"
#include "util.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
void DetectShutdownThread(boost::thread_group* threadGroup)
{
@ -138,7 +143,6 @@ bool AppInit(int argc, char* argv[]) @@ -138,7 +143,6 @@ bool AppInit(int argc, char* argv[])
return fRet;
}
extern void noui_connect();
int main(int argc, char* argv[])
{
bool fRet = false;

27
src/bitcoinrpc.cpp

@ -3,30 +3,27 @@ @@ -3,30 +3,27 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparams.h"
#include "main.h"
#include "wallet.h"
#include "bitcoinrpc.h"
#include "base58.h"
#include "init.h"
#include "main.h"
#include "util.h"
#include "sync.h"
#include "ui_interface.h"
#include "base58.h"
#include "bitcoinrpc.h"
#include "db.h"
#include "wallet.h"
#include <stdint.h>
#include <boost/algorithm/string.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/foreach.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/shared_ptr.hpp>
#include <list>
#include "json/json_spirit_writer_template.h"
using namespace std;
using namespace boost;
@ -89,18 +86,18 @@ void RPCTypeCheck(const Object& o, @@ -89,18 +86,18 @@ void RPCTypeCheck(const Object& o,
}
}
int64 AmountFromValue(const Value& value)
int64_t AmountFromValue(const Value& value)
{
double dAmount = value.get_real();
if (dAmount <= 0.0 || dAmount > 21000000.0)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
int64 nAmount = roundint64(dAmount * COIN);
int64_t nAmount = roundint64(dAmount * COIN);
if (!MoneyRange(nAmount))
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
return nAmount;
}
Value ValueFromAmount(int64 amount)
Value ValueFromAmount(int64_t amount)
{
return (double)amount / (double)COIN;
}
@ -897,7 +894,7 @@ void RPCRunHandler(const boost::system::error_code& err, boost::function<void(vo @@ -897,7 +894,7 @@ void RPCRunHandler(const boost::system::error_code& err, boost::function<void(vo
func();
}
void RPCRunLater(const std::string& name, boost::function<void(void)> func, int64 nSeconds)
void RPCRunLater(const std::string& name, boost::function<void(void)> func, int64_t nSeconds)
{
assert(rpc_io_service != NULL);

21
src/bitcoinrpc.h

@ -6,18 +6,19 @@ @@ -6,18 +6,19 @@
#ifndef _BITCOINRPC_H_
#define _BITCOINRPC_H_ 1
#include <string>
#include "uint256.h"
#include <list>
#include <map>
class CBlockIndex;
class CReserveKey;
#include <stdint.h>
#include <string>
#include "json/json_spirit_reader_template.h"
#include "json/json_spirit_writer_template.h"
#include "json/json_spirit_utils.h"
#include "json/json_spirit_writer_template.h"
#include "util.h"
class CBlockIndex;
class CReserveKey;
// HTTP status codes
enum HTTPStatusCode
@ -96,7 +97,7 @@ void RPCTypeCheck(const json_spirit::Object& o, @@ -96,7 +97,7 @@ void RPCTypeCheck(const json_spirit::Object& o,
Run func nSeconds from now. Uses boost deadline timers.
Overrides previous timer <name> (if any).
*/
void RPCRunLater(const std::string& name, boost::function<void(void)> func, int64 nSeconds);
void RPCRunLater(const std::string& name, boost::function<void(void)> func, int64_t nSeconds);
typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool fHelp);
@ -146,9 +147,9 @@ extern std::vector<unsigned char> ParseHexO(const json_spirit::Object& o, std::s @@ -146,9 +147,9 @@ extern std::vector<unsigned char> ParseHexO(const json_spirit::Object& o, std::s
extern void InitRPCMining();
extern void ShutdownRPCMining();
extern int64 nWalletUnlockTime;
extern int64 AmountFromValue(const json_spirit::Value& value);
extern json_spirit::Value ValueFromAmount(int64 amount);
extern int64_t nWalletUnlockTime;
extern int64_t AmountFromValue(const json_spirit::Value& value);
extern json_spirit::Value ValueFromAmount(int64_t amount);
extern double GetDifficulty(const CBlockIndex* blockindex = NULL);
extern std::string HexBits(unsigned int nBits);
extern std::string HelpRequiringPassphrase();

6
src/bloom.cpp

@ -1,13 +1,15 @@ @@ -1,13 +1,15 @@
// Copyright (c) 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 <math.h>
#include <stdlib.h>
#include "bloom.h"
#include "core.h"
#include "script.h"
#include <math.h>
#include <stdlib.h>
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
#define LN2 0.6931471805599453094172321214581765680755001343602552

7
src/bloom.h

@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
// Copyright (c) 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.
#ifndef BITCOIN_BLOOM_H
#define BITCOIN_BLOOM_H
#include <vector>
#include "uint256.h"
#include "serialize.h"
#include <vector>
class COutPoint;
class CTransaction;
class uint256;
// 20,000 items with fp rate < 0.1% or 10,000 items and <0.0001%
static const unsigned int MAX_BLOOM_FILTER_SIZE = 36000; // bytes

6
src/chainparams.cpp

@ -3,9 +3,9 @@ @@ -3,9 +3,9 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "assert.h"
#include "chainparams.h"
#include "assert.h"
#include "core.h"
#include "protocol.h"
#include "util.h"
@ -158,7 +158,7 @@ public: @@ -158,7 +158,7 @@ public:
// it'll get a pile of addresses with newer timestamps.
// Seed nodes are given a random 'last seen time' of between one and two
// weeks ago.
const int64 nOneWeek = 7*24*60*60;
const int64_t nOneWeek = 7*24*60*60;
struct in_addr ip;
memcpy(&ip, &pnSeed[i], sizeof(ip));
CAddress addr(CService(ip, GetDefaultPort()));

1
src/chainparams.h

@ -8,7 +8,6 @@ @@ -8,7 +8,6 @@
#include "bignum.h"
#include "uint256.h"
#include "util.h"
#include <vector>

14
src/checkpoints.cpp

@ -2,14 +2,16 @@ @@ -2,14 +2,16 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/foreach.hpp>
#include "checkpoints.h"
#include "main.h"
#include "uint256.h"
#include <stdint.h>
#include <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/foreach.hpp>
namespace Checkpoints
{
typedef std::map<int, uint256> MapCheckpoints;
@ -23,8 +25,8 @@ namespace Checkpoints @@ -23,8 +25,8 @@ namespace Checkpoints
struct CCheckpointData {
const MapCheckpoints *mapCheckpoints;
int64 nTimeLastCheckpoint;
int64 nTransactionsLastCheckpoint;
int64_t nTimeLastCheckpoint;
int64_t nTransactionsLastCheckpoint;
double fTransactionsPerDay;
};
@ -105,7 +107,7 @@ namespace Checkpoints @@ -105,7 +107,7 @@ namespace Checkpoints
if (pindex==NULL)
return 0.0;
int64 nNow = time(NULL);
int64_t nNow = time(NULL);
double fWorkBefore = 0.0; // Amount of work done before pindex
double fWorkAfter = 0.0; // Amount of work left after pindex (estimated)

3
src/checkpoints.h

@ -1,13 +1,14 @@ @@ -1,13 +1,14 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CHECKPOINT_H
#define BITCOIN_CHECKPOINT_H
#include <map>
class uint256;
class CBlockIndex;
class uint256;
/** Block-chain checkpoints are compiled-in sanity checks.
* They are updated every release or three.

11
src/checkqueue.h

@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
// Copyright (c) 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.
#ifndef CHECKQUEUE_H
#define CHECKQUEUE_H
#include <algorithm>
#include <vector>
#include <boost/foreach.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread/condition_variable.hpp>
#include <vector>
#include <algorithm>
#include <boost/thread/locks.hpp>
#include <boost/thread/mutex.hpp>
template<typename T> class CCheckQueueControl;

20
src/compat.h

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef _BITCOIN_COMPAT_H
#define _BITCOIN_COMPAT_H
@ -18,17 +19,24 @@ @@ -18,17 +19,24 @@
#undef FD_SETSIZE // prevent redefinition compiler warning
#endif
#define FD_SETSIZE 1024 // max number of fds in fd_set
#include <winsock2.h>
#include <winsock2.h> // Must be included before mswsock.h and windows.h
#include <mswsock.h>
#include <windows.h>
#include <ws2tcpip.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/fcntl.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <ifaddrs.h>
#include <limits.h>
#include <net/if.h>
#include <netdb.h>
#include <netinet/in.h>
#include <ifaddrs.h>
#include <sys/fcntl.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#ifdef WIN32

13
src/core.cpp

@ -4,8 +4,11 @@ @@ -4,8 +4,11 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "core.h"
#include "util.h"
#include <stdint.h>
std::string COutPoint::ToString() const
{
return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10).c_str(), n);
@ -50,7 +53,7 @@ void CTxIn::print() const @@ -50,7 +53,7 @@ void CTxIn::print() const
LogPrintf("%s\n", ToString().c_str());
}
CTxOut::CTxOut(int64 nValueIn, CScript scriptPubKeyIn)
CTxOut::CTxOut(int64_t nValueIn, CScript scriptPubKeyIn)
{
nValue = nValueIn;
scriptPubKey = scriptPubKeyIn;
@ -63,7 +66,7 @@ uint256 CTxOut::GetHash() const @@ -63,7 +66,7 @@ uint256 CTxOut::GetHash() const
std::string CTxOut::ToString() const
{
return strprintf("CTxOut(nValue=%"PRI64d".%08"PRI64d", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
return strprintf("CTxOut(nValue=%"PRId64".%08"PRId64", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
}
void CTxOut::print() const
@ -135,7 +138,7 @@ void CTransaction::print() const @@ -135,7 +138,7 @@ void CTransaction::print() const
// * if e==9, we only know the resulting number is not zero, so output 1 + 10*(n - 1) + 9
// (this is decodable, as d is in [1-9] and e is in [0-9])
uint64 CTxOutCompressor::CompressAmount(uint64 n)
uint64_t CTxOutCompressor::CompressAmount(uint64_t n)
{
if (n == 0)
return 0;
@ -154,7 +157,7 @@ uint64 CTxOutCompressor::CompressAmount(uint64 n) @@ -154,7 +157,7 @@ uint64 CTxOutCompressor::CompressAmount(uint64 n)
}
}
uint64 CTxOutCompressor::DecompressAmount(uint64 x)
uint64_t CTxOutCompressor::DecompressAmount(uint64_t x)
{
// x = 0 OR x = 1+10*(9*n + d - 1) + e OR x = 1+10*(n - 1) + 9
if (x == 0)
@ -163,7 +166,7 @@ uint64 CTxOutCompressor::DecompressAmount(uint64 x) @@ -163,7 +166,7 @@ uint64 CTxOutCompressor::DecompressAmount(uint64 x)
// x = 10*(9*n + d - 1) + e
int e = x % 10;
x /= 10;
uint64 n = 0;
uint64_t n = 0;
if (e < 9) {
// x = 9*n + d - 1
int d = (x % 9) + 1;

31
src/core.h

@ -2,14 +2,17 @@ @@ -2,14 +2,17 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CORE_H
#define BITCOIN_CORE_H
#include "uint256.h"
#include "serialize.h"
#include "script.h"
#include "serialize.h"
#include "uint256.h"
#include <stdint.h>
#include <stdio.h>
#include <boost/foreach.hpp>
class CTransaction;
@ -114,7 +117,7 @@ public: @@ -114,7 +117,7 @@ public:
class CTxOut
{
public:
int64 nValue;
int64_t nValue;
CScript scriptPubKey;
CTxOut()
@ -122,7 +125,7 @@ public: @@ -122,7 +125,7 @@ public:
SetNull();
}
CTxOut(int64 nValueIn, CScript scriptPubKeyIn);
CTxOut(int64_t nValueIn, CScript scriptPubKeyIn);
IMPLEMENT_SERIALIZE
(
@ -143,7 +146,7 @@ public: @@ -143,7 +146,7 @@ public:
uint256 GetHash() const;
bool IsDust(int64 nMinRelayTxFee) const
bool IsDust(int64_t nMinRelayTxFee) const
{
// "Dust" is defined in terms of CTransaction::nMinRelayTxFee,
// which has units satoshis-per-kilobyte.
@ -178,8 +181,8 @@ public: @@ -178,8 +181,8 @@ public:
class CTransaction
{
public:
static int64 nMinTxFee;
static int64 nMinRelayTxFee;
static int64_t nMinTxFee;
static int64_t nMinRelayTxFee;
static const int CURRENT_VERSION=1;
int nVersion;
std::vector<CTxIn> vin;
@ -246,17 +249,17 @@ private: @@ -246,17 +249,17 @@ private:
CTxOut &txout;
public:
static uint64 CompressAmount(uint64 nAmount);
static uint64 DecompressAmount(uint64 nAmount);
static uint64_t CompressAmount(uint64_t nAmount);
static uint64_t DecompressAmount(uint64_t nAmount);
CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
IMPLEMENT_SERIALIZE(({
if (!fRead) {
uint64 nVal = CompressAmount(txout.nValue);
uint64_t nVal = CompressAmount(txout.nValue);
READWRITE(VARINT(nVal));
} else {
uint64 nVal = 0;
uint64_t nVal = 0;
READWRITE(VARINT(nVal));
txout.nValue = DecompressAmount(nVal);
}
@ -599,9 +602,9 @@ public: @@ -599,9 +602,9 @@ public:
uint256 GetHash() const;
int64 GetBlockTime() const
int64_t GetBlockTime() const
{
return (int64)nTime;
return (int64_t)nTime;
}
};

9
src/crypter.cpp

@ -2,12 +2,13 @@ @@ -2,12 +2,13 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <openssl/aes.h>
#include <openssl/evp.h>
#include <vector>
#include "crypter.h"
#include <string>
#include <vector>
#include "crypter.h"
#include <openssl/aes.h>
#include <openssl/evp.h>
bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod)
{

6
src/crypter.h

@ -1,13 +1,15 @@ @@ -1,13 +1,15 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef __CRYPTER_H__
#define __CRYPTER_H__
#include "allocators.h" /* for SecureString */
#include "key.h"
#include "allocators.h"
#include "serialize.h"
class uint256;
const unsigned int WALLET_CRYPTO_KEY_SIZE = 32;
const unsigned int WALLET_CRYPTO_SALT_SIZE = 8;

23
src/db.cpp

@ -3,19 +3,24 @@ @@ -3,19 +3,24 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparams.h"
#include "db.h"
#include "util.h"
#include "hash.h"
#include "addrman.h"
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <openssl/rand.h>
#include "hash.h"
#include "protocol.h"
#include "util.h"
#include <inttypes.h>
#include <stdint.h>
#ifndef WIN32
#include "sys/stat.h"
#include <sys/stat.h>
#endif
#include <boost/filesystem.hpp>
#include <boost/version.hpp>
#include <openssl/rand.h>
using namespace std;
using namespace boost;
@ -430,7 +435,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip) @@ -430,7 +435,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
void CDBEnv::Flush(bool fShutdown)
{
int64 nStart = GetTimeMillis();
int64_t nStart = GetTimeMillis();
// Flush log data to the actual data file
// on all files that are not in use
LogPrint("db", "Flush(%s)%s\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started");
@ -459,7 +464,7 @@ void CDBEnv::Flush(bool fShutdown) @@ -459,7 +464,7 @@ void CDBEnv::Flush(bool fShutdown)
else
mi++;
}
LogPrint("db", "DBFlush(%s)%s ended %15"PRI64d"ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
LogPrint("db", "DBFlush(%s)%s ended %15"PRId64"ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
if (fShutdown)
{
char** listp;

9
src/db.h

@ -2,30 +2,29 @@ @@ -2,30 +2,29 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_DB_H
#define BITCOIN_DB_H
#include "sync.h"
#include "serialize.h"
#include "sync.h"
#include "version.h"
#include <map>
#include <string>
#include <vector>
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>
#include <db_cxx.h>
class CAddrMan;
struct CBlockLocator;
class CDiskBlockIndex;
class CMasterKey;
class COutPoint;
class CWallet;
extern unsigned int nWalletDBUpdated;
void ThreadFlushWalletDB(const std::string& strWalletFile);
bool BackupWallet(const CWallet& wallet, const std::string& strDest);
class CDBEnv

9
src/hash.h

@ -2,16 +2,19 @@ @@ -2,16 +2,19 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_HASH_H
#define BITCOIN_HASH_H
#include "uint256.h"
#include "serialize.h"
#include "uint256.h"
#include "version.h"
#include <openssl/sha.h>
#include <openssl/ripemd.h>
#include <vector>
#include <openssl/ripemd.h>
#include <openssl/sha.h>
template<typename T1>
inline uint256 Hash(const T1 pbegin, const T1 pend)
{

45
src/init.cpp

@ -8,29 +8,30 @@ @@ -8,29 +8,30 @@
#endif
#include "init.h"
#include "main.h"
#include "core.h"
#include "chainparams.h"
#include "txdb.h"
#include "walletdb.h"
#include "addrman.h"
#include "bitcoinrpc.h"
#include "net.h"
#include "util.h"
#include "checkpoints.h"
#include "miner.h"
#include "net.h"
#include "txdb.h"
#include "ui_interface.h"
#include "checkpoints.h"
#include "util.h"
#include "wallet.h"
#include "walletdb.h"
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <openssl/crypto.h>
#include <inttypes.h>
#include <stdint.h>
#ifndef WIN32
#include <signal.h>
#endif
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <openssl/crypto.h>
using namespace std;
using namespace boost;