Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build-aux/m4/bitcoin_qt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
])

BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,BITCOIN_QT_FAIL(zlib not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([zstd] ,[main],,BITCOIN_QT_FAIL(zstd not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,BITCOIN_QT_FAIL(png not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found)))
Expand Down
90 changes: 87 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 6)
define(_CLIENT_VERSION_REVISION, 7)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2014)
AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@bitcoin.org],[bitcoin])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4])
LT_INIT([disable-shared])

dnl Unless the user specified ARFLAGS, force it to be cr
AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
if test "x${ARFLAGS+set}" != "xset"; then
ARFLAGS="cr"
fi

AC_CANONICAL_HOST
AH_TOP([#ifndef BITCOIN_CONFIG_H])
AH_TOP([#define BITCOIN_CONFIG_H])
Expand Down Expand Up @@ -155,7 +162,7 @@ if test "x$enable_debug" = xyes; then
if test "x$GXX" = xyes; then
CXXFLAGS="-g3 -rdynamic -O0 -DDEBUG"
fi
fi
fi

## TODO: Remove these hard-coded paths and flags. They are here for the sake of
## compatibility with the legacy buildsystem.
Expand Down Expand Up @@ -199,6 +206,9 @@ case $host in
AC_CHECK_LIB([userenv], [main],, AC_MSG_ERROR(lib missing))
AC_CHECK_LIB([dwmapi], [main],, AC_MSG_ERROR(lib missing))
AC_CHECK_LIB([pcre2-16], [main],, AC_MSG_ERROR(lib missing))
AC_CHECK_LIB([wtsapi32], [main],, AC_MSG_ERROR(lib missing))
AC_CHECK_LIB([zstd], [main],, AC_MSG_ERROR(lib missing))
AC_CHECK_LIB([opengl32], [main],, AC_MSG_ERROR(lib missing))

AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"])
AX_CHECK_LINK_FLAG([[-static-libgcc]],[LDFLAGS="$LDFLAGS -static-libgcc"])
Expand Down Expand Up @@ -599,7 +609,6 @@ AC_MSG_RESULT($build_bitcoin_cli)
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])


if test x$use_ipv6 = xyes; then
dnl Check for ipv6 build requirements
AC_MSG_CHECKING(for operating system IPv6 support)
Expand Down Expand Up @@ -779,3 +788,78 @@ AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile src/qt/Makefile src/qt/
AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh])
AC_OUTPUT

detect_build_os() {
# Detect WSL
if grep -qEi "(Microsoft|WSL)" /proc/version &> /dev/null; then
# WSL specific commands
if test -f "/etc/os-release"; then
. /etc/os-release
linux_dist="${PRETTY_NAME:-$ID}"
else
# Fallback to lsb_release if /etc/os-release is not available
if type lsb_release >/dev/null 2>&1; then
linux_dist=$(lsb_release -d | cut -f2)
else
linux_dist="Unknown Linux"
fi
fi

echo "WSL (${linux_dist})"
elif [ "$(uname)" = "Linux" ]; then
# Regular Linux
if test -f "/etc/os-release"; then
. /etc/os-release
linux_dist="${PRETTY_NAME:-$ID}"
elif type lsb_release >/dev/null 2>&1; then
linux_dist=$(lsb_release -d | cut -f2)
else
linux_dist="Unknown Linux"
fi
echo "$linux_dist"
elif [ "$(uname)" = "Darwin" ]; then
# macOS
echo "macOS $(sw_vers -productVersion)"
else
# Unknown OS
echo "Unknown OS"
fi
}

# Store the result in a variable
BUILD_OS=$(detect_build_os)

# Define color variables using tput
LIGHT_GREY=$(tput setaf 249)
MEDIUM_GREY=$(tput setaf 245)
DARK_GREY=$(tput setaf 235)
NC=$(tput sgr0) # No Color

# Start of the script
echo "${DARK_GREY}═══════════════════════════════════════════════════════════════════════════${NC}"
echo "${MEDIUM_GREY}============================ System Information ===========================${NC}"
echo "${DARK_GREY}═══════════════════════════════════════════════════════════════════════════${NC}"
echo "${MEDIUM_GREY}Target OS: ${LIGHT_GREY}$TARGET_OS${NC}"
echo "${MEDIUM_GREY}Build OS: ${LIGHT_GREY}$BUILD_OS${NC}"
echo "${DARK_GREY}═══════════════════════════════════════════════════════════════════════════${NC}"
echo "${MEDIUM_GREY}=========================== Application Options ===========================${NC}"
echo "${DARK_GREY}═══════════════════════════════════════════════════════════════════════════${NC}"
echo "${MEDIUM_GREY}Wallet Support: ${LIGHT_GREY}$enable_wallet${NC}"
echo "${MEDIUM_GREY}GUI/Qt Support: ${LIGHT_GREY}$bitcoin_enable_qt${NC}"
if test x$bitcoin_enable_qt != xno; then
echo " ${MEDIUM_GREY}Qt Version: ${LIGHT_GREY}$bitcoin_qt_got_major_vers${NC}"
echo " ${MEDIUM_GREY}QR Support: ${LIGHT_GREY}$use_qr${NC}"
fi
echo "${MEDIUM_GREY}UPnP Support: ${LIGHT_GREY}$use_upnp${NC}"
echo "${MEDIUM_GREY}Debugging: ${LIGHT_GREY}$enable_debug${NC}"
echo "${DARK_GREY}═══════════════════════════════════════════════════════════════════════════${NC}"
echo "${MEDIUM_GREY}============================ Compiler Settings ============================${NC}"
echo "${DARK_GREY}═══════════════════════════════════════════════════════════════════════════${NC}"
echo "${MEDIUM_GREY}Compiler (C): ${LIGHT_GREY}$CC${NC}"
echo "${MEDIUM_GREY}C Flags: ${LIGHT_GREY}$CFLAGS${NC}"
echo "${MEDIUM_GREY}Preprocessor Flags: ${LIGHT_GREY}$CPPFLAGS${NC}"
echo "${MEDIUM_GREY}Compiler (C++): ${LIGHT_GREY}$CXX${NC}"
echo "${MEDIUM_GREY}C++ Flags: ${LIGHT_GREY}$CXXFLAGS${NC}"
echo "${MEDIUM_GREY}Linker Flags: ${LIGHT_GREY}$LDFLAGS${NC}"
echo "${MEDIUM_GREY}AR Flags: ${LIGHT_GREY}$ARFLAGS${NC}"
echo "${DARK_GREY}═══════════════════════════════════════════════════════════════════════════${NC}"
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include Makefile.include

AM_CPPFLAGS += -I$(builddir) -fpermissive -ffloat-store -std=c++11 -D__STDC_LIMIT_MACROS -D__USE_MINGW_ANSI_STDIO
AM_CPPFLAGS += -I$(builddir) -fpermissive -ffloat-store -std=c++17 -D__STDC_LIMIT_MACROS -D__USE_MINGW_ANSI_STDIO

noinst_LIBRARIES = \
libcryptonite_server.a \
Expand Down
6 changes: 3 additions & 3 deletions src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class CAddrMan
READWRITE(info);
am->mapAddr[info] = n;
info.nRandomPos = vRandom.size();
am->vRandom.push_back(n);
am->vRandom.emplace_back(n);
if (nUBuckets != ADDRMAN_NEW_BUCKET_COUNT)
{
am->vvNew[info.GetNewBucket(am->nKey)].insert(n);
Expand All @@ -349,10 +349,10 @@ class CAddrMan
{
info.nRandomPos = vRandom.size();
info.fInTried = true;
am->vRandom.push_back(am->nIdCount);
am->vRandom.emplace_back(am->nIdCount);
am->mapInfo[am->nIdCount] = info;
am->mapAddr[info] = am->nIdCount;
vTried.push_back(am->nIdCount);
vTried.emplace_back(am->nIdCount);
am->nIdCount++;
} else {
nLost++;
Expand Down
2 changes: 1 addition & 1 deletion src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class CBitcoinSecret : public CBase58Data
assert(vchSecret.IsValid());
SetData(Params().Base58Prefix(CChainParams::SECRET_KEY), vchSecret.begin(), vchSecret.size());
if (vchSecret.IsCompressed())
vchData.push_back(1);
vchData.emplace_back(1);
}

CKey GetKey()
Expand Down
30 changes: 16 additions & 14 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CMainParams : public CChainParams {
bnProofOfWorkLimit = ~uint256(0) >> 20;
nSubsidyHalvingInterval = 210000;

//printf("Target: %s\n", GetTargetWork(4096.0).GetHex().c_str()); exit(0);
//printf("Target: %s\n", GetTargetWork(4096.0).GetHex().c_str()); exit(0);

// Build the genesis block. Note that the output of the genesis coinbase cannot
// be spent as it did not originally exist in the database.
Expand All @@ -80,21 +80,21 @@ class CMainParams : public CChainParams {
txNew.vout[0].nValue = MAX_MONEY; //All coins created in genesis
txNew.vout[0].pubKey = 0; //Genesis target is coinbase
txNew.nLockHeight=0;
string msg = "2014/07/27 - Epoch Times - How Bitcoin Compares...";
txNew.msg = vector<char>(msg.begin(),msg.end());
genesis.vtx.push_back(txNew);
string msg = "2014/07/27 - Epoch Times - How Bitcoin Compares...";
txNew.msg = vector<char>(msg.begin(),msg.end());
genesis.vtx.push_back(txNew);
genesis.hashPrevBlock = 0;
genesis.hashMerkleRoot = genesis.BuildMerkleTree();

//Build a single trienode to find the hash of the coinbase only trie
TrieNode *coinbase = new TrieNode(NODE_LEAF);
coinbase->SetKey(0);
coinbase->SetBalance(txNew.vout[0].nValue);
//Build a single trienode to find the hash of the coinbase only trie
TrieNode *coinbase = new TrieNode(NODE_LEAF);
coinbase->SetKey(0);
coinbase->SetBalance(txNew.vout[0].nValue);

genesis.hashAccountRoot = coinbase->Hash(); //TODO: get the trie hash
delete coinbase;
genesis.hashAccountRoot = coinbase->Hash(); //TODO: get the trie hash
delete coinbase;
genesis.nVersion = 1;
genesis.nHeight = 0;
genesis.nHeight = 0;
genesis.nTime = 1406509200;
genesis.nNonce = 1041215929;

Expand All @@ -105,10 +105,12 @@ class CMainParams : public CChainParams {
if(hashGenesisBlock != uint256("0x000009a460ccc429ac6e53c91c6ed2d96697884b8b656a903042faff8971c5aa"))
MineGenesis(genesis);

vSeeds.push_back(CDNSSeedData("explorer.cryptonite.info", "explorer.cryptonite.info"));
vSeeds.push_back(CDNSSeedData("xcn.suprnova.cc", "xcn.suprnova.cc"));
vSeeds.push_back(CDNSSeedData("explorer.digicent.org", "explorer.digicent.org"));

vSeeds.emplace_back("dnsseed.cryptonite.info", "dnsseed.cryptonite.info");
// vSeeds.emplace_back("xcn.suprnova.cc", "xcn.suprnova.cc");
// vSeeds.emplace_back("explorer.digicent.org", "explorer.digicent.org");


//sa ToDO: Review. The convert_to_container stuff was added as a quick fix to get it building in c++11. it should work
// but not 100% certain and haven't tested
base58Prefixes[PUBKEY_ADDRESS] = (list_of(28)).convert_to_container<vector<unsigned char> >();
Expand Down
2 changes: 1 addition & 1 deletion src/checkqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ template<typename T> class CCheckQueue {
void Add(std::vector<T> &vChecks) {
boost::unique_lock<boost::mutex> lock(mutex);
for (T &check : vChecks) {
queue.push_back(T());
queue.emplace_back(T());
check.swap(queue.back());
}
nTodo += vChecks.size();
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 9
#define CLIENT_VERSION_REVISION 5
#define CLIENT_VERSION_REVISION 6
#define CLIENT_VERSION_BUILD 99

// Set to true for release, false for prerelease or test build
Expand Down
14 changes: 6 additions & 8 deletions src/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
#include <boost/version.hpp>
#include <openssl/rand.h>

namespace fs = boost::filesystem;
using namespace std;
using namespace boost;


unsigned int nWalletDBUpdated;



//
// CDB
//
Expand All @@ -44,7 +42,7 @@ void CDBEnv::EnvShutdown()
if (ret != 0)
LogPrintf("CDBEnv::EnvShutdown : Error %d shutting down database environment: %s\n", ret, DbEnv::strerror(ret));
if (!fMockDb)
DbEnv(0).remove(path.string().c_str(), 0);
DbEnv(static_cast<u_int32_t>(0)).remove(path.string().c_str(), 0);
}

CDBEnv::CDBEnv() : dbenv(DB_CXX_NO_EXCEPTIONS)
Expand All @@ -63,17 +61,17 @@ void CDBEnv::Close()
EnvShutdown();
}

bool CDBEnv::Open(const boost::filesystem::path& pathIn)
bool CDBEnv::Open(const fs::path& pathIn)
{
if (fDbEnvInit)
return true;

boost::this_thread::interruption_point();

path = pathIn;
filesystem::path pathLogDir = path / "database";
fs::path pathLogDir = path / "database";
TryCreateDirectory(pathLogDir);
filesystem::path pathErrorFile = path / "db.log";
fs::path pathErrorFile = path / "db.log";
LogPrintf("CDBEnv::Open : LogDir=%s ErrorFile=%s\n", pathLogDir.string(), pathErrorFile.string());

unsigned int nEnvFlags = 0;
Expand Down Expand Up @@ -471,7 +469,7 @@ void CDBEnv::Flush(bool fShutdown)
dbenv.log_archive(&listp, DB_ARCH_REMOVE);
Close();
if (!fMockDb)
boost::filesystem::remove_all(path / "database");
fs::remove_all(path / "database");
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/hashblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ GLOBAL sph_haval256_5_context z_haval;
GLOBAL sph_tiger_context z_tiger;
GLOBAL sph_ripemd160_context z_ripemd;



#define fillz() do { \
sph_sha512_init(&z_sha512); \
sph_sha256_init(&z_sha256); \
Expand Down Expand Up @@ -145,15 +143,8 @@ inline uint256 Hash7(const T1 pbegin, const T1 pend)
sph_sha256 (&ctx_sha256, data,bytes);
sph_sha256_close(&ctx_sha256, static_cast<void*>(&finalhash));


free(data);
return finalhash;
}






#endif // HASHBLOCK_H

Loading