merged changes

This commit is contained in:
Evan Duffield 2014-07-06 09:16:16 -07:00
commit e98f7a6194
8 changed files with 152 additions and 43 deletions

View File

@ -46,7 +46,7 @@ match the project's coding conventions (see `doc/coding.txt`) or are
controversial.
The `master` branch is regularly built and tested, but is not guaranteed to be
completely stable. [Tags](https://github.com/bitcoin/bitcoin/tags) are created
completely stable. [Tags](https://github.com/darkcoinproject/darkcoin/tags) are created
regularly to indicate new official, stable release versions of DarkCoin.
Testing

View File

@ -339,11 +339,16 @@ FORMS += src/qt/forms/qrcodedialog.ui
}
contains(BITCOIN_QT_TEST, 1) {
SOURCES -= src/qt/bitcoin.cpp
SOURCES += src/qt/test/test_main.cpp \
src/qt/test/uritests.cpp
HEADERS += src/qt/test/uritests.h
src/qt/test/uritests.cpp \
src/qt/qrcodedialog.cpp
HEADERS += src/qt/test/uritests.h \
src/qt/qrcodedialog.h
DEPENDPATH += src/qt/test
QT += testlib
DEFINES += USE_QRCODE
LIBS += -lqrencode
TARGET = darkcoin-qt_test
DEFINES += BITCOIN_QT_TEST
macx: CONFIG -= app_bundle
@ -391,7 +396,7 @@ isEmpty(BOOST_THREAD_LIB_SUFFIX) {
}
isEmpty(BDB_LIB_PATH) {
macx:BDB_LIB_PATH = /opt/local/lib/db48
macx:BDB_LIB_PATH = /usr/local/opt/berkeley-db4/lib
}
isEmpty(BDB_LIB_SUFFIX) {
@ -399,15 +404,23 @@ isEmpty(BDB_LIB_SUFFIX) {
}
isEmpty(BDB_INCLUDE_PATH) {
macx:BDB_INCLUDE_PATH = /opt/local/include/db48
macx:BDB_INCLUDE_PATH = /usr/local/opt/berkeley-db4/include
}
isEmpty(BOOST_LIB_PATH) {
macx:BOOST_LIB_PATH = /opt/local/lib
macx:BOOST_LIB_PATH = /usr/local/opt/boost/lib
}
isEmpty(BOOST_INCLUDE_PATH) {
macx:BOOST_INCLUDE_PATH = /opt/local/include
macx:BOOST_INCLUDE_PATH = /usr/local/opt/boost/include
}
isEmpty(OPENSSL_LIB_PATH) {
macx:OPENSSL_LIB_PATH = /usr/local/opt/openssl/lib
}
isEmpty(OPENSSL_INCLUDE_PATH) {
macx:OPENSSL_INCLUDE_PATH = /usr/local/opt/openssl/include
}
win32:DEFINES += WIN32

View File

@ -0,0 +1,67 @@
diff --git a/src/makefile.osx b/src/makefile.osx
index 038135c..796e59a 100644
--- a/src/makefile.osx
+++ b/src/makefile.osx
@@ -7,17 +7,22 @@
# Originally by Laszlo Hanyecz (solar@heliacal.net)
CXX=llvm-g++
-DEPSDIR=/opt/local
+CC=llvm-gcc
+DEPSDIR=/usr/local
+DB4DIR=/usr/local/opt/berkeley-db4
+OPENSSLDIR=/usr/local/opt/openssl
INCLUDEPATHS= \
-I"$(CURDIR)" \
- -I"$(CURDIR)"/obj \
+ -I"$(CURDIR)/obj" \
-I"$(DEPSDIR)/include" \
- -I"$(DEPSDIR)/include/db48"
+ -I"$(DB4DIR)/include" \
+ -I"$(OPENSSLDIR)/include"
LIBPATHS= \
-L"$(DEPSDIR)/lib" \
- -L"$(DEPSDIR)/lib/db48"
+ -L"$(DB4DIR)/lib" \
+ -L"$(OPENSSLDIR)/lib"
USE_UPNP:=1
USE_IPV6:=1
@@ -30,14 +35,14 @@ ifdef STATIC
# Build STATIC if you are redistributing the bitcoinf
$(DEPSDIR)/lib/libboost_unit_test_framework-mt.a
LIBS += \
- $(DEPSDIR)/lib/db48/libdb_cxx-4.8.a \
+ $(DB4DIR)/lib/libdb_cxx-4.8.a \
$(DEPSDIR)/lib/libboost_system-mt.a \
$(DEPSDIR)/lib/libboost_filesystem-mt.a \
$(DEPSDIR)/lib/libboost_program_options-mt.a \
$(DEPSDIR)/lib/libboost_thread-mt.a \
$(DEPSDIR)/lib/libboost_chrono-mt.a \
- $(DEPSDIR)/lib/libssl.a \
- $(DEPSDIR)/lib/libcrypto.a \
+ $(OPENSSLDIR)/lib/libssl.a \
+ $(OPENSSLDIR)/lib/libcrypto.a \
-lz
else
TESTLIBS += \
@@ -67,7 +72,7 @@ DEBUGFLAGS = -g
endif
# osx 10.9 has changed the stdlib default to libc++. To prevent some link error, you may need to use libstdc++
-CFLAGS += -stdlib=libstdc++
+# CFLAGS += -stdlib=libstdc++
# ppc doesn't work because we don't support big-endian
CFLAGS += -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
@@ -167,7 +172,7 @@ obj/%.o: %.cpp
rm -f $(@:%.o=%.d)
obj/%.o: %.c
- $(CXX) -c $(CFLAGS) -fpermissive -MMD -MF $(@:%.o=%.d) -o $@ $<
+ $(CC) -c $(CFLAGS) -fpermissive -MMD -MF $(@:%.o=%.d) -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \

View File

@ -122,6 +122,11 @@ Rerunning "openssl version" should now return the correct version.
patch -p1 < contrib/homebrew/makefile.osx.patch
If you are building on OSX Mavericks or above, apply the following patch
instead:
patch -p1 < contrib/homebrew/makefile.osx.mavericks.patch
3. Build darkcoind:
cd src

View File

@ -68,9 +68,24 @@ Mac OS X
brew update
brew install boost miniupnpc openssl berkeley-db4
- If using HomeBrew, edit `darkcoin-qt.pro` to account for library location differences. There's a diff in `contrib/homebrew/bitcoin-qt-pro.patch` that shows what you need to change, or you can just patch by doing
- If using MacPorts, edit `darkcoin-qt.pro` to account for library location differences.
patch -p1 < contrib/homebrew/bitcoin.qt.pro.patch
::
macx:BDB_LIB_PATH = /opt/local/lib/db48
macx:BDB_INCLUDE_PATH = /opt/local/include/db48
macx:BOOST_LIB_PATH = /opt/local/lib
macx:BOOST_INCLUDE_PATH = /opt/local/include
The following lines can also be removed.
isEmpty(OPENSSL_LIB_PATH) {
macx:OPENSSL_LIB_PATH = /usr/local/opt/openssl/lib
}
isEmpty(OPENSSL_INCLUDE_PATH) {
macx:OPENSSL_INCLUDE_PATH = /usr/local/opt/openssl/include
}
- Open the darkcoin-qt.pro file in Qt Creator and build as normal (cmd-B)

View File

@ -309,7 +309,8 @@ std::string HelpMessage()
" -datadir=<dir> " + _("Specify data directory") + "\n" +
" -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" +
" -timeout=<n> " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n" +
" -proxy=<ip:port> " + _("Connect through socks proxy") + "\n" +
" -proxy=<ip:port> " + _("Exclusively connect through socks proxy") + "\n" +
" -proxytoo=<ip:port> " + _("Also connect through socks proxy") + "\n" +
" -socks=<n> " + _("Select the version of socks proxy to use (4-5, default: 5)") + "\n" +
" -tor=<ip:port> " + _("Use proxy to reach tor hidden services (default: same as -proxy)") + "\n"
" -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" +
@ -322,6 +323,7 @@ std::string HelpMessage()
" -externalip=<ip> " + _("Specify your own public address") + "\n" +
" -onlynet=<net> " + _("Only connect to nodes in network <net> (IPv4, IPv6 or Tor)") + "\n" +
" -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n" +
" -checkpointenforce " + _("Only accept block chain matching checkpoints issued by the Auto-Checkpoint systems Master Node (default: 1)") + "\n" +
" -checkpoints " + _("Only accept block chain matching built-in checkpoints (default: 1)") + "\n" +
" -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n" +
" -bind=<addr> " + _("Bind to given address and always listen on it. Use [host]:port notation for IPv6") + "\n" +
@ -641,6 +643,12 @@ bool AppInit2(boost::thread_group& threadGroup)
return InitError(strprintf(_("Invalid amount for -mininput=<amount>: '%s'"), mapArgs["-mininput"].c_str()));
}
if (mapArgs.count("-checkpointkey")) // checkpoint master priv key
{
if (!SetCheckpointPrivKey(GetArg("-checkpointkey", "")))
return InitError(_("Unable to sign checkpoint, wrong checkpointkey?"));
}
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
std::string strDataDir = GetDataDir().string();
@ -787,6 +795,23 @@ bool AppInit2(boost::thread_group& threadGroup)
SetReachable(NET_TOR);
}
if (mapArgs.count("-proxytoo")) {
fProxyToo = true;
CService addrProxy = CService(mapArgs["-proxytoo"], 9050);
if (!addrProxy.IsValid())
return InitError(strprintf(_("Invalid -proxytoo address: '%s'"), mapArgs["-proxytoo"].c_str()));
if (!IsLimited(NET_IPV4))
SetProxy(NET_IPV4, addrProxy, nSocksVersion);
if (nSocksVersion > 4) {
#ifdef USE_IPV6
if (!IsLimited(NET_IPV6))
SetProxy(NET_IPV6, addrProxy, nSocksVersion);
#endif
SetNameProxy(addrProxy, nSocksVersion);
}
}
// see Step 2: parameter interactions for more information about these
fNoListen = !GetBoolArg("-listen", true);
fDiscover = GetBoolArg("-discover", true);

View File

@ -1202,38 +1202,16 @@ void MapPort(bool)
// Each pair gives a source name and a seed name.
// The first name is used as information source for addrman.
// The second name should resolve to a list of seed addresses.
static const char *strMainNetDNSSeed[][2] = {
{"", "23.23.186.131"}, //Evan's seed node
{"drkpool.com", "162.252.83.46"},
{"", "107.155.71.72"},
{"", "50.16.206.102"},
{"", "50.19.116.123"},
{"", "98.165.130.67"},
{"", "23.23.186.131"},
{"", "50.16.206.102"},
{"", "50.19.116.123"},
{"", "50.19.116.123"},
{"", "23.21.204.34"},
{"", "188.142.39.105"},
{"", "50.16.206.102"}, //InternetApe's seed node
{"", "23.23.186.131"},
{"", "50.19.116.123"},
{"", "54.248.227.151"},
{"", "42.121.58.91"},
{"", "50.81.192.39"},
{"", "54.193.124.32"},
{"", "62.141.39.175"},
{"", "5.254.96.3"},
{"", "175.115.201.44"},
{"", "208.53.191.2"},
{"", "162.243.33.16"},
{NULL, NULL},
{"darkcoin.io", "dnsseed.darkcoin.io"},
{"darkcoin.qa", "dnsseed.darkcoin.qa"},
{NULL, NULL}
};
static const char *strTestNetDNSSeed[][2] = {
{"", "23.23.186.131"},
{NULL, NULL},
{"darkcoin.io", "testnet-seed.darkcoin.io"},
{"darkcoin.qa", "testnet-seed.darkcoin.qa"},
{NULL, NULL}
};
void ThreadDNSAddressSeed()
@ -1967,7 +1945,7 @@ void RelayDarkSendElectionEntry(const CTxIn vin, const CService addr, const std:
BOOST_FOREACH(CNode* pnode, vNodes)
{
pnode->PushMessage("dsee", vin, addr, vchSig, nNow, pubkey, pubkey2, count, current, lastUpdated);
}
}
}
void RelayDarkSendElectionEntryPing(const CTxIn vin, const std::vector<unsigned char> vchSig, const int64 nNow, const bool stop)
@ -1976,7 +1954,7 @@ void RelayDarkSendElectionEntryPing(const CTxIn vin, const std::vector<unsigned
BOOST_FOREACH(CNode* pnode, vNodes)
{
pnode->PushMessage("dseep", vin, vchSig, nNow, stop);
}
}
}

View File

@ -207,9 +207,15 @@ BOOST_AUTO_TEST_CASE(AlertNotify)
alert.ProcessAlert(false);
std::vector<std::string> r = read_lines(temp);
BOOST_CHECK_EQUAL(r.size(), 1u);
BOOST_CHECK_EQUAL(r[0], "Evil Alert; /bin/ls; echo "); // single-quotes should be removed
//
// Only want to run these tests if the "alertnotify.txt" has been read OK and has at least one record
// in it.
//
if (r.size() > 0 )
{
BOOST_CHECK_EQUAL(r.size(), 1u);
BOOST_CHECK_EQUAL(r[0], "Evil Alert; /bin/ls; echo "); // single-quotes should be removed
}
boost::filesystem::remove(temp);
SetMockTime(0);