This commit is contained in:
Evan Duffield 2015-05-04 02:36:23 -07:00
commit 160eec6e30
23 changed files with 208 additions and 734 deletions

View File

@ -190,7 +190,7 @@ check-local:
@qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1
endif
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-dash-cli qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)

View File

@ -1,5 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) ?? ??? 5 03:11:45 2015
# Automatically generated by qmake (2.01a) ?? ??? 17 02:23:35 2015
######################################################################
TEMPLATE = app
@ -39,8 +39,8 @@ INCLUDEPATH += . \
src/crypto \
src/primitives \
src/script \
src/univalue \
src/obj \
src/univalue \
src/json \
src/compat \
src/secp256k1/include \
@ -88,6 +88,7 @@ HEADERS += src/activemasternode.h \
src/leveldbwrapper.h \
src/limitedmap.h \
src/main.h \
src/masternode-payments.h \
src/masternode-pos.h \
src/masternode.h \
src/masternodeconfig.h \
@ -383,6 +384,7 @@ SOURCES += src/activemasternode.cpp \
src/keystore.cpp \
src/leveldbwrapper.cpp \
src/main.cpp \
src/masternode-payments.cpp \
src/masternode-pos.cpp \
src/masternode.cpp \
src/masternodeconfig.cpp \
@ -478,7 +480,6 @@ SOURCES += src/activemasternode.cpp \
src/qt/paymentrequestplus.cpp \
src/qt/paymentserver.cpp \
src/qt/peertablemodel.cpp \
src/qt/qrc_darkcoin.cpp \
src/qt/qvalidatedlineedit.cpp \
src/qt/qvaluecombobox.cpp \
src/qt/receivecoinsdialog.cpp \
@ -527,6 +528,7 @@ SOURCES += src/activemasternode.cpp \
src/test/hash_tests.cpp \
src/test/key_tests.cpp \
src/test/main_tests.cpp \
src/test/mempool_tests.cpp \
src/test/miner_tests.cpp \
src/test/mruset_tests.cpp \
src/test/multisig_tests.cpp \

View File

@ -20,7 +20,7 @@ Sanity checks:
Once you've got the right hardware and software:
git clone git://github.com/darkcoin/darkcoin.git
git clone git://github.com/dashpay/dash.git
git clone git://github.com/devrandom/gitian-builder.git
mkdir gitian-builder/inputs
cd gitian-builder/inputs
@ -62,5 +62,5 @@ Here's a description of Gavin's setup on OSX 10.6:
5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right hardware and software" instructions above:
export USE_LXC=1
git clone git://github.com/darkcoin/darkcoin.git
git clone git://github.com/dashpay/dash.git
... etc

View File

@ -1,5 +1,5 @@
---
name: "dash-linux-0.10"
name: "dash-linux-0.12"
enable_cache: true
suites:
- "precise"

View File

@ -1,60 +0,0 @@
---
name: "dash"
suites:
- "precise"
architectures:
- "i386"
packages:
- "git-core"
- "automake"
- "faketime"
- "bsdmainutils"
- "pkg-config"
- "p7zip-full"
reference_datetime: "2014-01-10 00:00:00"
remotes:
- "url": "https://github.com/darkcoin/darkcoin.git"
"dir": "dash"
files:
- "osx-native-depends-r3.tar.gz"
- "osx-depends-r7.tar.gz"
- "osx-depends-qt-5.2.1-r6.tar.gz"
- "MacOSX10.7.sdk.tar.gz"
script: |
HOST=x86_64-apple-darwin11
PREFIX=`pwd`/osx-cross-depends/prefix
SDK=`pwd`/osx-cross-depends/SDKs/MacOSX10.7.sdk
NATIVEPREFIX=`pwd`/osx-cross-depends/native-prefix
export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export SOURCES_PATH=`pwd`
mkdir -p osx-cross-depends/SDKs
tar -C osx-cross-depends/SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz
tar -C osx-cross-depends -xf osx-native-depends-r3.tar.gz
tar -C osx-cross-depends -xf osx-depends-r7.tar.gz
tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r6.tar.gz
export PATH=`pwd`/osx-cross-depends/native-prefix/bin:$PATH
cd dash
export ZERO_AR_DATE=1
export QT_RCC_TEST=1
./autogen.sh
./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode
make dist
mkdir -p distsrc
cd distsrc
tar --strip-components=1 -xf ../dash-*.tar*
./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode
make $MAKEOPTS
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC
make deploy
dmg dmg Dash-Qt.dmg $OUTDIR/Dash-Qt.dmg

View File

@ -1,159 +0,0 @@
---
name: "osx-depends"
suites:
- "precise"
architectures:
- "i386"
packages:
- "git-core"
- "automake"
- "p7zip-full"
reference_datetime: "2013-06-01 00:00:00"
remotes: []
files:
- "boost_1_55_0.tar.bz2"
- "db-4.8.30.NC.tar.gz"
- "miniupnpc-1.9.20140701.tar.gz"
- "openssl-1.0.1k.tar.gz"
- "protobuf-2.5.0.tar.bz2"
- "qrencode-3.4.3.tar.bz2"
- "MacOSX10.7.sdk.tar.gz"
- "osx-native-depends-r3.tar.gz"
script: |
echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | sha256sum -c
echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c
echo "26f3985bad7768b8483b793448ae49414cdc4451d0ec83e7c1944367e15f9f07 miniupnpc-1.9.20140701.tar.gz" | sha256sum -c
echo "8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c openssl-1.0.1k.tar.gz" | sha256sum -c
echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c
echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c
REVISION=r7
export SOURCES_PATH=`pwd`
export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export PATH=$HOME:$PATH
export SOURCES_PATH=`pwd`
export ZERO_AR_DATE=1
mkdir -p osx-cross-depends/build
cd osx-cross-depends
PREFIX=`pwd`/prefix
NATIVEPREFIX=`pwd`/native-prefix
BUILD_BASE=`pwd`/build
SDK=`pwd`/SDKs/MacOSX10.7.sdk
HOST=x86_64-apple-darwin11
MIN_VERSION=10.6
INT_CFLAGS="-target ${HOST} -mmacosx-version-min=${MIN_VERSION} --sysroot ${SDK} -msse2 -Qunused-arguments"
INT_CXXFLAGS="${INT_CFLAGS}"
INT_LDFLAGS="-L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1"
INT_LDFLAGS_CLANG="-B${NATIVEPREFIX}/bin"
INT_CPPFLAGS="-I${PREFIX}/include"
INT_CC=clang
INT_CXX=clang++
INT_OBJC=clang
INT_OBJCXX=clang++
INT_AR=${HOST}-ar
INT_RANLIB=${HOST}-ranlib
INT_LIBTOOL=${HOST}-libtool
INT_INSTALL_NAME_TOOL=${HOST}-install_name_tool
export PATH=${NATIVEPREFIX}/bin:${PATH}
mkdir -p ${NATIVEPREFIX}/bin
mkdir -p ${NATIVEPREFIX}/lib
mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/lib
mkdir -p ${BUILD_BASE}
mkdir -p SDKs
tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz
tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz
# bdb
SOURCE_FILE=${SOURCES_PATH}/db-4.8.30.NC.tar.gz
BUILD_DIR=${BUILD_BASE}/db-4.8.30.NC
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' ${BUILD_DIR}/dbinc/atomic.h
pushd ${BUILD_DIR}
cd build_unix;
../dist/configure --host=${HOST} --prefix="${PREFIX}" --disable-shared --enable-cxx CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}"
make $MAKEOPTS libdb.a libdb_cxx.a
make install_lib install_include
popd
# openssl
SOURCE_FILE=${SOURCES_PATH}/openssl-1.0.1k.tar.gz
BUILD_DIR=${BUILD_BASE}/openssl-1.0.1k
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
pushd ${BUILD_DIR}
sed -ie "s|cc:|${INT_CC}:|" ${BUILD_DIR}/Configure
sed -ie "s|\(-arch [_a-zA-Z0-9]*\)|\1 --sysroot ${SDK} -target ${HOST} -msse2|" ${BUILD_DIR}/Configure
AR="${INT_AR}" RANLIB="${INT_RANLIB}" ./Configure --prefix=${PREFIX} --openssldir=${PREFIX}/etc/openssl zlib shared no-krb5 darwin64-x86_64-cc ${INT_LDFLAGS} ${INT_CLANG_LDFLAGS} ${INT_CPPFLAGS}
sed -i "s|engines apps test|engines|" ${BUILD_DIR}/Makefile
sed -i "/define DATE/d" ${BUILD_DIR}/crypto/Makefile
make -j1 build_libs libcrypto.pc libssl.pc openssl.pc
make -j1 install_sw
popd
#libminiupnpc
SOURCE_FILE=${SOURCES_PATH}/miniupnpc-1.9.20140701.tar.gz
BUILD_DIR=${BUILD_BASE}/miniupnpc-1.9.20140701
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
pushd ${BUILD_DIR}
CFLAGS="${INT_CFLAGS} ${INT_CPPFLAGS}" make $MAKEOPTS OS=Darwin CC="${INT_CC}" AR="${INT_AR}" libminiupnpc.a
install -d ${PREFIX}/include/miniupnpc
install *.h ${PREFIX}/include/miniupnpc
install libminiupnpc.a ${PREFIX}/lib
popd
# qrencode
SOURCE_FILE=${SOURCES_PATH}/qrencode-3.4.3.tar.bz2
BUILD_DIR=${BUILD_BASE}/qrencode-3.4.3
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
pushd ${BUILD_DIR}
# m4 folder is not included in the stable release, which can confuse aclocal
# if its timestamp ends up being earlier than configure.ac when extracted
touch aclocal.m4
./configure --host=${HOST} --prefix="${PREFIX}" --disable-shared CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" --disable-shared -without-tools --disable-sdltest --disable-dependency-tracking
make $MAKEOPTS
make install
popd
# libprotobuf
SOURCE_FILE=${SOURCES_PATH}/protobuf-2.5.0.tar.bz2
BUILD_DIR=${BUILD_BASE}/protobuf-2.5.0
tar -C ${BUILD_BASE} -xjf ${SOURCE_FILE}
pushd ${BUILD_DIR}
./configure --host=${HOST} --prefix="${PREFIX}" --disable-shared --enable-cxx CC="${INT_CC}" CXX="${INT_CXX}" AR="${INT_AR}" RANLIB="${INT_RANLIB}" OBJC="${INT_OBJC}" OBJCXX="${INT_OBJCXX}" CFLAGS="${INT_CFLAGS}" CXXFLAGS="${INT_CXXFLAGS}" LDFLAGS="${INT_CLANG_LDFLAGS} ${INT_LDFLAGS}" CPPFLAGS="${INT_CPPFLAGS}" --enable-shared=no --disable-dependency-tracking --with-protoc=${NATIVEPREFIX}/bin/protoc
cd src
make $MAKEOPTS libprotobuf.la
make install-libLTLIBRARIES install-nobase_includeHEADERS
cd ..
make install-pkgconfigDATA
popd
# boost
SOURCE_FILE=${SOURCES_PATH}/boost_1_55_0.tar.bz2
BUILD_DIR=${BUILD_BASE}/boost_1_55_0
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
pushd ${BUILD_DIR}
./bootstrap.sh --with-libraries=chrono,filesystem,program_options,system,thread,test
echo "using darwin : : ${INT_CXX} : <cxxflags>\"${INT_CFLAGS} ${INT_CPPFLAGS}\" <linkflags>\"${INT_LDFLAGS} ${INT_CLANG_LDFLAGS}\" <archiver>\"${INT_LIBTOOL}\" <striper>\"${INT_STRIP}\" : ;" > "user-config.jam"
./b2 -d2 --layout=tagged --build-type=complete --prefix="${PREFIX}" --toolset=darwin-4.2.1 --user-config=user-config.jam variant=release threading=multi link=static install
popd
export GZIP="-9n"
find prefix | sort | tar --no-recursion -czf osx-depends-${REVISION}.tar.gz -T -
mv osx-depends-${REVISION}.tar.gz $OUTDIR

View File

@ -1,178 +0,0 @@
---
name: "osx-native"
suites:
- "precise"
architectures:
- "i386"
packages:
- "git-core"
- "automake"
- "faketime"
- "libssl-dev"
- "libbz2-dev"
- "libz-dev"
- "cmake"
- "libcap-dev"
- "p7zip-full"
- "uuid-dev"
reference_datetime: "2013-06-01 00:00:00"
remotes: []
files:
- "10cc648683617cca8bcbeae507888099b41b530c.tar.gz"
- "cctools-809.tar.gz"
- "dyld-195.5.tar.gz"
- "ld64-127.2.tar.gz"
- "protobuf-2.5.0.tar.bz2"
- "MacOSX10.7.sdk.tar.gz"
- "cdrkit-1.1.11.tar.gz"
- "libdmg-hfsplus-v0.1.tar.gz"
- "clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz"
- "cdrkit-deterministic.patch"
script: |
echo "18406961fd4a1ec5c7ea35c91d6a80a2f8bb797a2bd243a610bd75e13eff9aca 10cc648683617cca8bcbeae507888099b41b530c.tar.gz" | sha256sum -c
echo "03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad cctools-809.tar.gz" | sha256sum -c
echo "2cf0484c87cf79b606b351a7055a247dae84093ae92c747a74e0cde2c8c8f83c dyld-195.5.tar.gz" | sha256sum -c
echo "97b75547b2bd761306ab3e15ae297f01e7ab9760b922bc657f4ef72e4e052142 ld64-127.2.tar.gz" | sha256sum -c
echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c
echo "d1c030756ecc182defee9fe885638c1785d35a2c2a297b4604c0e0dcc78e47da cdrkit-1.1.11.tar.gz" | sha256sum -c
echo "6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3 libdmg-hfsplus-v0.1.tar.gz" | sha256sum -c
echo "b9d57a88f9514fa1f327a1a703756d0c1c960f4c58494a5bd80313245d13ffff clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz" | sha256sum -c
echo "cc12bdbd7a09f71cb2a6a3e6ec3e0abe885ca7111c2b47857f5095e5980caf4f cdrkit-deterministic.patch" | sha256sum -c
REVISION=r3
export REFERENCE_DATETIME
export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC
REAL_AR=`which ar`
REAL_RANLIB=`which ranlib`
REAL_DATE=`which date`
echo '#!/bin/bash' > $HOME/ar
echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar
echo "$REAL_AR \"\$@\"" >> $HOME/ar
echo '#!/bin/bash' > $HOME/ranlib
echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ranlib
echo "$REAL_RANLIB \"\$@\"" >> $HOME/ranlib
echo '#!/bin/bash' > $HOME/date
echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/date
echo "$REAL_DATE \"\$@\"" >> $HOME/date
chmod +x $HOME/ar $HOME/ranlib $HOME/date
export PATH=$HOME:$PATH
export SOURCES_PATH=`pwd`
mkdir -p osx-cross-depends/build
cd osx-cross-depends
NATIVEPREFIX=`pwd`/native-prefix
BUILD_BASE=`pwd`/build
SDK=`pwd`/SDKs/MacOSX10.7.sdk
HOST=x86_64-apple-darwin11
MIN_VERSION=10.6
CFLAGS=""
CXXFLAGS="${CFLAGS}"
LDFLAGS="-L${NATIVEPREFIX}/lib"
export PATH=${NATIVEPREFIX}/bin:${PATH}
mkdir -p ${NATIVEPREFIX}/bin
mkdir -p ${NATIVEPREFIX}/lib
mkdir -p SDKs
tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz
# Clang
SOURCE_FILE=${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz
BUILD_DIR=${BUILD_BASE}/clang+llvm-3.2-x86-linux-ubuntu-12.04
mkdir -p ${NATIVEPREFIX}/lib/clang/3.2/include
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
cp ${BUILD_DIR}/bin/clang ${NATIVEPREFIX}/bin/
cp ${BUILD_DIR}/bin/clang++ ${NATIVEPREFIX}/bin/
cp ${BUILD_DIR}/lib/libLTO.so ${NATIVEPREFIX}/lib/
cp ${BUILD_DIR}/lib/clang/3.2/include/* ${NATIVEPREFIX}/lib/clang/3.2/include
# cctools
SOURCE_FILE=${SOURCES_PATH}/10cc648683617cca8bcbeae507888099b41b530c.tar.gz
BUILD_DIR=${BUILD_BASE}/toolchain4-10cc648683617cca8bcbeae507888099b41b530c
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
mkdir -p ${BUILD_DIR}/sdks
pushd ${BUILD_DIR}/sdks;
ln -sf ${SDK} MacOSX10.7.sdk
ln -sf ${SOURCES_PATH}/cctools-809.tar.gz ${BUILD_DIR}/cctools2odcctools/cctools-809.tar.gz
ln -sf ${SOURCES_PATH}/ld64-127.2.tar.gz ${BUILD_DIR}/cctools2odcctools/ld64-127.2.tar.gz
ln -sf ${SOURCES_PATH}/dyld-195.5.tar.gz ${BUILD_DIR}/cctools2odcctools/dyld-195.5.tar.gz
tar -C ${BUILD_DIR} -xf ${SOURCES_PATH}/clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz
# Hack in the use of our llvm headers rather than grabbing the old llvm-gcc.
sed -i "s|GCC_DIR|LLVM_CLANG_DIR|g" ${BUILD_DIR}/cctools2odcctools/extract.sh
sed -i "s|llvmgcc42-2336.1|clang+llvm-3.2-x86-linux-ubuntu-12.04|g" ${BUILD_DIR}/cctools2odcctools/extract.sh
sed -i "s|\${LLVM_CLANG_DIR}/llvmCore/include/llvm-c|\${LLVM_CLANG_DIR}/include/llvm-c \${LLVM_CLANG_DIR}/include/llvm |" ${BUILD_DIR}/cctools2odcctools/extract.sh
sed -i "s|fAC_INIT|AC_INIT|" ${BUILD_DIR}/cctools2odcctools/files/configure.ac
sed -i 's/\# Dynamically linked LTO/\t ;\&\n\t linux*)\n# Dynamically linked LTO/' ${BUILD_DIR}/cctools2odcctools/files/configure.ac
cd ${BUILD_DIR}/cctools2odcctools
./extract.sh --osxver 10.7
cd odcctools-809
./configure --prefix=${NATIVEPREFIX} --target=${HOST} CFLAGS="${CFLAGS} -I${NATIVEPREFIX}/include -D__DARWIN_UNIX03 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" LDFLAGS="${LDFLAGS} -Wl,-rpath=\\\$\$ORIGIN/../lib" --with-sysroot=${SDK}
# The 'PC' define in sparc/reg.h conflicts but doesn't get used anyway. Just rename it.
sed -i "s|define\tPC|define\tPC_|" ${BUILD_DIR}/cctools2odcctools/odcctools-809/include/architecture/sparc/reg.h
make $MAKEOPTS
make install
popd
# protoc
SOURCE_FILE=${SOURCES_PATH}/protobuf-2.5.0.tar.bz2
BUILD_DIR=${BUILD_BASE}/protobuf-2.5.0
tar -C ${BUILD_BASE} -xjf ${SOURCE_FILE}
pushd ${BUILD_DIR};
./configure --enable-shared=no --disable-dependency-tracking --prefix=${NATIVEPREFIX}
make $MAKEOPTS
cp ${BUILD_DIR}/src/protoc ${NATIVEPREFIX}/bin/
popd
# cdrkit
SOURCE_FILE=${SOURCES_PATH}/cdrkit-1.1.11.tar.gz
BUILD_DIR=${BUILD_BASE}/cdrkit-1.1.11
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
pushd ${BUILD_DIR}
patch -p1 < ${SOURCES_PATH}/cdrkit-deterministic.patch
cmake -DCMAKE_INSTALL_PREFIX=${NATIVEPREFIX}
make $MAKEOPTS genisoimage
make -C genisoimage install
popd
# libdmg-hfsplus
SOURCE_FILE=${SOURCES_PATH}/libdmg-hfsplus-v0.1.tar.gz
BUILD_DIR=${BUILD_BASE}/libdmg-hfsplus-libdmg-hfsplus-v0.1
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
mkdir -p ${BUILD_DIR}/build
pushd ${BUILD_DIR}/build
cmake -DCMAKE_INSTALL_PREFIX:PATH=${NATIVEPREFIX}/bin ..
make $MAKEOPTS
make install
popd
rm -rf native-prefix/docs
export GZIP="-9n"
find native-prefix | sort | tar --no-recursion -czf osx-native-depends-$REVISION.tar.gz -T -
mv osx-native-depends-$REVISION.tar.gz $OUTDIR

View File

@ -1,186 +0,0 @@
---
name: "osx-qt"
suites:
- "precise"
architectures:
- "i386"
packages:
- "git-core"
- "automake"
- "p7zip-full"
reference_datetime: "2013-06-01 00:00:00"
remotes: []
files:
- "qt-everywhere-opensource-src-5.2.1.tar.gz"
- "osx-native-depends-r3.tar.gz"
- "osx-depends-r7.tar.gz"
- "MacOSX10.7.sdk.tar.gz"
script: |
echo "84e924181d4ad6db00239d87250cc89868484a14841f77fb85ab1f1dbdcd7da1 qt-everywhere-opensource-src-5.2.1.tar.gz" | sha256sum -c
REVISION=r6
export SOURCES_PATH=`pwd`
export TAR_OPTIONS="-m --mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export ZERO_AR_DATE=1
export TZ=UTC
REAL_DATE=`which date`
echo '#!/bin/bash' > $HOME/date
echo "$REAL_DATE -d \"${REFERENCE_DATETIME}\" \"\$@\"" >> $HOME/date
chmod +x $HOME/date
export PATH=$HOME:$PATH
mkdir -p osx-cross-depends/build
cd osx-cross-depends
PREFIX=`pwd`/prefix
NATIVEPREFIX=`pwd`/native-prefix
BUILD_BASE=`pwd`/build
SDK=`pwd`/SDKs/MacOSX10.7.sdk
HOST=x86_64-apple-darwin11
MIN_VERSION=10.6
INT_CFLAGS="-target ${HOST} -mmacosx-version-min=${MIN_VERSION} --sysroot ${SDK} -msse2 -Qunused-arguments"
INT_CXXFLAGS="${INT_CFLAGS}"
INT_LDFLAGS="-L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1"
INT_LDFLAGS_CLANG="-B${NATIVEPREFIX}/bin"
INT_CPPFLAGS="-I${PREFIX}/include"
INT_CC=clang
INT_CXX=clang++
INT_OBJC=clang
INT_OBJCXX=clang++
INT_AR=${HOST}-ar
INT_RANLIB=${HOST}-ranlib
INT_LIBTOOL=${HOST}-libtool
INT_INSTALL_NAME_TOOL=${HOST}-install_name_tool
export PATH=${NATIVEPREFIX}/bin:${PATH}
mkdir -p ${NATIVEPREFIX}/bin
mkdir -p ${NATIVEPREFIX}/lib
mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/lib
mkdir -p ${BUILD_BASE}
mkdir -p SDKs
tar -C SDKs -xf ${SOURCES_PATH}/MacOSX10.7.sdk.tar.gz
tar xf /home/ubuntu/build/osx-native-depends-r3.tar.gz
export PATH=`pwd`/native-prefix/bin:$PATH
tar xf /home/ubuntu/build/osx-depends-r7.tar.gz
SOURCE_FILE=${SOURCES_PATH}/qt-everywhere-opensource-src-5.2.1.tar.gz
BUILD_DIR=${BUILD_BASE}/qt-everywhere-opensource-src-5.2.1
tar -C ${BUILD_BASE} -xf ${SOURCE_FILE}
# Install our mkspec. All files are pulled from the macx-clang spec, except for
# our custom qmake.conf
SPECFILE=${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/qmake.conf
mkdir -p ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux
cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/Info.plist.lib ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/
cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/Info.plist.app ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/
cp -f ${BUILD_DIR}/qtbase/mkspecs/macx-clang/qplatformdefs.h ${BUILD_DIR}/qtbase/mkspecs/macx-clang-linux/
cat > ${SPECFILE} <<ENDCONF
MAKEFILE_GENERATOR = UNIX
CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname absolute_library_soname
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/macx.conf)
include(../common/gcc-base-mac.conf)
include(../common/clang.conf)
include(../common/clang-mac.conf)
QMAKE_XCODE_VERSION=4.3
QMAKE_XCODE_DEVELOPER_PATH=/Developer
QMAKE_MACOSX_DEPLOYMENT_TARGET = ${MIN_VERSION}
QMAKE_MAC_SDK=macosx
QMAKE_MAC_SDK.macosx.path = ${SDK}
QMAKE_MAC_SDK.macosx.platform_name = macosx
QMAKE_MAC_SDK_PATH=${SDK}
QMAKE_CFLAGS += -target ${HOST}
QMAKE_OBJECTIVE_CFLAGS += -target ${HOST}
QMAKE_CXXFLAGS += -target ${HOST}
QMAKE_LFLAGS += -target ${HOST}
QMAKE_AR = ${HOST}-ar cq
QMAKE_RANLIB=${HOST}-ranlib
QMAKE_LIBTOOL=${HOST}-libtool
QMAKE_INSTALL_NAME_TOOL=${HOST}-install_name_tool
load(qt_config)
ENDCONF
pushd ${BUILD_DIR}
./configure -release -opensource -openssl-linked \
-no-audio-backend -no-javascript-jit -no-sql-sqlite -no-sql-tds \
-no-cups -no-iconv -no-dbus -no-gif -no-audio-backend -no-freetype \
-no-javascript-jit -no-sql-sqlite -no-nis -no-cups -no-iconv -no-pch \
-no-dbus -no-gif -no-sm -nomake examples -no-feature-style-plastique \
-no-xcb -no-qml-debug -no-pch -no-nis \
-no-feature-style-cde -no-feature-style-s60 -no-feature-style-motif \
-no-feature-style-windowsmobile -no-feature-style-windowsce \
-no-feature-style-cleanlooks \
-no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql \
-no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 \
-skip qtsvg -skip qtwebkit -skip qtwebkit-examples -skip qtserialport \
-skip qtdeclarative -skip qtmultimedia -skip qtimageformats \
-skip qtlocation -skip qtsensors -skip qtquick1 -skip qtxmlpatterns \
-skip qtquickcontrols -skip qtactiveqt -skip qtconnectivity \
-skip qtwinextras -skip qtscript \
-prefix ${PREFIX} -bindir ${NATIVEPREFIX}/bin \
-confirm-license -xplatform macx-clang-linux -v ${INT_LDFLAGS}
# RCC's output is sorted using each file entry's hash as the key. Unfortunately,
# the hash function uses a random seed for each run so the results aren't
# deterministic. This leads to static resources being defined in a random order,
# which in-turn means that object files are not predictable.
# Fortunately, this upsets Qt's unit tests as well, so they've added the
# QT_RCC_TEST environment variable to set a pre-defined seed. Here, do the same
# thing for the same reason.
QT_RCC_TEST=1 make $MAKEOPTS module-qtbase-make_first
make $MAKEOPTS module-qttranslations-make_first
make $MAKEOPTS module-qttools-make_first
make $MAKEOPTS -C qtbase
make -C qtbase install
make -C qttranslations install
make -C qttools/src/linguist install
popd
# This file should not be installed to the destination. It's native and
# non-deterministic. Remove it.
# See: https://bugreports.qt-project.org/browse/QTBUG-31393
rm -f ${PREFIX}/lib/libQt5Bootstrap.a
rm -f ${PREFIX}/lib/Qt*.framework/Qt*.prl
pushd ${PREFIX}/include
ln -sf ../lib/QtNetwork.framework/Headers/ QtNetwork
ln -sf ../lib/QtWidgets.framework/Headers/ QtWidgets
ln -sf ../lib/QtGui.framework/Headers/ QtGui
ln -sf ../lib/QtCore.framework/Headers/ QtCore
ln -sf ../lib/QtTest.framework/Headers/ QtTest
popd
rm -f ${PREFIX}/lib/*.la
find ${PREFIX}/lib -name "*.prl" -delete
export GZIP="-9n"
find native-prefix prefix | sort | tar --no-recursion -czf osx-depends-qt-5.2.1-${REVISION}.tar.gz -T -
mv osx-depends-qt-5.2.1-${REVISION}.tar.gz $OUTDIR

View File

@ -1,5 +1,5 @@
---
name: "dash-win-0.10"
name: "dash-win-0.12"
enable_cache: true
suites:
- "precise"

View File

@ -37,7 +37,6 @@ Release Process
git checkout v${VERSION}
popd
pushd ./gitian-builder
mkdir -p inputs; cd inputs/
###fetch and build inputs: (first time, or when dependency versions change)

View File

@ -11,6 +11,6 @@ EXEEXT="@EXEEXT@"
@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
REAL_BITCOIND="$BUILDDIR/src/bitcoind${EXEEXT}"
REAL_BITCOINCLI="$BUILDDIR/src/bitcoin-cli${EXEEXT}"
REAL_BITCOIND="$BUILDDIR/src/dashd${EXEEXT}"
REAL_BITCOINCLI="$BUILDDIR/src/dash-cli${EXEEXT}"

View File

@ -362,7 +362,7 @@ dashd_SOURCES = dashd.cpp
#
if TARGET_WINDOWS
dashd_SOURCES += dash-res.rc
dashd_SOURCES += dashd-res.rc
endif
dashd_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
@ -406,6 +406,7 @@ dash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
if BUILD_BITCOIN_LIBS
include_HEADERS = script/bitcoinconsensus.h
libbitcoinconsensus_la_SOURCES = \
allocators.cpp \
primitives/transaction.cpp \
crypto/hmac_sha512.cpp \
crypto/sha1.cpp \

View File

@ -176,6 +176,7 @@ RES_ICONS = \
qt/res/icons/bitcoin.png \
qt/res/icons/bitcoin_testnet.ico \
qt/res/icons/bitcoin_testnet.png \
qt/res/icons/browse.png \
qt/res/icons/clock1.png \
qt/res/icons/clock2.png \
qt/res/icons/clock3.png \
@ -188,6 +189,10 @@ RES_ICONS = \
qt/res/icons/connect3_16.png \
qt/res/icons/connect4_16.png \
qt/res/icons/debugwindow.png \
qt/res/icons/drkblue_editpaste.png \
qt/res/icons/drkblue_address-book.png \
qt/res/icons/drkblue_editcopy.png \
qt/res/icons/drkblue_remove.png \
qt/res/icons/edit.png \
qt/res/icons/editcopy.png \
qt/res/icons/editpaste.png \
@ -300,7 +305,7 @@ qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \
$(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES)
$(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_CSS) $(RES_MOVIES)
nodist_qt_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \
$(PROTOBUF_H) $(QT_QRC_CPP) $(QT_QRC_LOCALE_CPP)
@ -357,7 +362,7 @@ $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name dash_locale $(@D)/$(<F) | \
$(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H)
$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_CSS) $(RES_MOVIES) $(PROTOBUF_H)
@test -f $(RCC)
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name dash $< | \
$(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@

View File

@ -65,8 +65,6 @@ out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT {}
length_error::~length_error() _GLIBCXX_USE_NOEXCEPT {}
length_error::~length_error() _GLIBCXX_USE_NOEXCEPT { }
// Used with permission.
// See: https://github.com/madlib/madlib/commit/c3db418c0d34d6813608f2137fef1012ce03043d

View File

@ -1418,25 +1418,28 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
// ** find the coins we'll use
std::vector<CTxIn> vCoins;
int64_t nValueMin = CENT;
int64_t nValueIn = 0;
CAmount nValueMin = CENT;
CAmount nValueIn = 0;
CAmount nOnlyDenominatedBalance;
CAmount nBalanceNeedsDenominated;
// should not be less than fees in DARKSEND_COLLATERAL + few (lets say 5) smallest denoms
int64_t nLowestDenom = DARKSEND_COLLATERAL + darkSendDenominations[darkSendDenominations.size() - 1]*5;
CAmount nLowestDenom = DARKSEND_COLLATERAL + darkSendDenominations[darkSendDenominations.size() - 1]*5;
// if there are no DS collateral inputs yet
if(!pwalletMain->HasCollateralInputs())
// should have some additional amount for them
nLowestDenom += DARKSEND_COLLATERAL*4;
int64_t nBalanceNeedsAnonymized = nAnonymizeDarkcoinAmount*COIN - pwalletMain->GetAnonymizedBalance();
CAmount nBalanceNeedsAnonymized = nAnonymizeDarkcoinAmount*COIN - pwalletMain->GetAnonymizedBalance();
// if balanceNeedsAnonymized is more than pool max, take the pool max
if(nBalanceNeedsAnonymized > DARKSEND_POOL_MAX) nBalanceNeedsAnonymized = DARKSEND_POOL_MAX;
// if balanceNeedsAnonymized is more than non-anonymized, take non-anonymized
int64_t nBalanceNotYetAnonymized = pwalletMain->GetBalance() - pwalletMain->GetAnonymizedBalance();
if(nBalanceNeedsAnonymized > nBalanceNotYetAnonymized) nBalanceNeedsAnonymized = nBalanceNotYetAnonymized;
CAmount nAnonymizableBalance = pwalletMain->GetAnonymizableBalance();
if(nBalanceNeedsAnonymized > nAnonymizableBalance) nBalanceNeedsAnonymized = nAnonymizableBalance;
if(nBalanceNeedsAnonymized < nLowestDenom)
{
@ -1455,7 +1458,13 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
if (pwalletMain->SelectCoinsDark(nValueMin, 9999999*COIN, vCoins, nValueIn, -2, 0))
{
if(!fDryRun) return CreateDenominated(nBalanceNeedsAnonymized);
nOnlyDenominatedBalance = pwalletMain->GetDenominatedBalance(true, false, false);
nBalanceNeedsDenominated = nBalanceNeedsAnonymized - nOnlyDenominatedBalance;
if(nBalanceNeedsDenominated > nValueIn) nBalanceNeedsDenominated = nValueIn;
if(!fDryRun) return CreateDenominated(nBalanceNeedsDenominated);
return true;
} else {
LogPrintf("DoAutomaticDenominating : Can't denominate - no compatible inputs left\n");
@ -1465,6 +1474,11 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
}
nOnlyDenominatedBalance = pwalletMain->GetDenominatedBalance(true, false, false);
nBalanceNeedsDenominated = nBalanceNeedsAnonymized - nOnlyDenominatedBalance;
if(!fDryRun && nBalanceNeedsDenominated > nOnlyDenominatedBalance) return CreateDenominated(nBalanceNeedsDenominated);
//check to see if we have the collateral sized inputs, it requires these
if(!pwalletMain->HasCollateralInputs()){
if(!fDryRun) MakeCollateralAmounts();
@ -1622,7 +1636,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
pSubmittedToMasternode = pmn;
vecMasternodesUsed.push_back(pmn->vin);
std::vector<int64_t> vecAmounts;
std::vector<CAmount> vecAmounts;
pwalletMain->ConvertList(vCoins, vecAmounts);
sessionDenom = GetDenominationsByAmounts(vecAmounts);

View File

@ -5,10 +5,10 @@
#include "keepass.h"
#include <exception>
#include <openssl/rand.h>
// #include <openssl/rand.h>
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
//#include <boost/asio.hpp>
// #include <boost/asio.hpp>
#include "json/json_spirit_writer_template.h"
#include "json/json_spirit_reader_template.h"

View File

@ -2932,6 +2932,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
{
if(Params().NetworkID() != CBaseChainParams::REGTEST)
return state.DoS(100, error("CheckBlock() : Couldn't find masternode payment or payee"));
}
}
@ -2965,10 +2966,30 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
int nHeight = pindexPrev->nHeight+1;
// Check proof of work
if ((!Params().SkipProofOfWorkCheck()) &&
(block.nBits != GetNextWorkRequired(pindexPrev, &block)))
return state.DoS(100, error("%s : incorrect proof of work", __func__),
// if ((!Params().SkipProofOfWorkCheck()) &&
// (block.nBits != GetNextWorkRequired(pindexPrev, &block)))
// return state.DoS(100, error("%s : incorrect proof of work", __func__),
// REJECT_INVALID, "bad-diffbits");
if(Params().NetworkID() == CBaseChainParams::TESTNET) {
if (block.nBits != GetNextWorkRequired(pindexPrev, &block))
return state.DoS(100, error("%s : incorrect proof of work at %d", __func__, nHeight),
REJECT_INVALID, "bad-diffbits");
} else {
// Check proof of work (Here for the architecture issues with DGW v1 and v2)
if(nHeight <= 68589){
unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, &block);
double n1 = ConvertBitsToDouble(block.nBits);
double n2 = ConvertBitsToDouble(nBitsNext);
if (abs(n1-n2) > n1*0.5)
return state.DoS(100, error("%s : incorrect proof of work (DGW pre-fork) - %f %f %f at %d", __func__, abs(n1-n2), n1, n2, nHeight),
REJECT_INVALID, "bad-diffbits");
} else {
if (block.nBits != GetNextWorkRequired(pindexPrev, &block))
return state.DoS(100, error("%s : incorrect proof of work at %d", __func__, nHeight),
REJECT_INVALID, "bad-diffbits");
}
}
// Check timestamp against prev
if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())
@ -3068,27 +3089,6 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
if (ppindex)
*ppindex = pindex;
// ***TODO*** probably not the right place
if(Params().NetworkID() == CBaseChainParams::TESTNET) {
if (block.nBits != GetNextWorkRequired(pindexPrev, &block))
return state.DoS(100, error("AcceptBlock() : incorrect proof of work"),
REJECT_INVALID, "bad-diffbits");
} else {
// Check proof of work (Here for the architecture issues with DGW v1 and v2)
if(pindexPrev->nHeight+1 <= 68589){
unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, &block);
double n1 = ConvertBitsToDouble(block.nBits);
double n2 = ConvertBitsToDouble(nBitsNext);
if (abs(n1-n2) > n1*0.5)
return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW pre-fork) - %f", abs(n1-n2)),
REJECT_INVALID, "bad-diffbits");
} else {
if (block.nBits != GetNextWorkRequired(pindexPrev, &block))
return state.DoS(100, error("AcceptBlock() : incorrect proof of work"),
REJECT_INVALID, "bad-diffbits");
}
}
return true;
}
@ -3235,7 +3235,7 @@ bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDis
CMasternode* pmn = mnodeman.Find(vin);
if(pmn != NULL) pmn->nLastPaid = GetAdjustedTime();
LogPrintf("ProcessBlock() : Update Masternode Last Paid Time - %d\n", chainActive.Tip()->nHeight);
LogPrintf("%s : Update Masternode Last Paid Time - %d\n", __func__, chainActive.Tip()->nHeight);
}
@ -3246,7 +3246,7 @@ bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDis
}
}
LogPrintf("ProcessBlock: ACCEPTED\n");
LogPrintf("%s : ACCEPTED\n", __func__);
return true;
}

View File

@ -13,7 +13,7 @@
#include <math.h>
unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const CBlockHeader *pblock, uint64_t PastBlocksMin, uint64_t PastBlocksMax) {
unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast) {
const CBlockIndex *BlockLastSolved = pindexLast;
const CBlockIndex *BlockReading = pindexLast;
uint64_t PastBlocksMass = 0;
@ -26,14 +26,25 @@ unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const CBloc
double EventHorizonDeviationFast;
double EventHorizonDeviationSlow;
uint64_t pastSecondsMin = Params().TargetTimespan() * 0.025;
uint64_t pastSecondsMax = Params().TargetTimespan() * 7;
uint64_t PastBlocksMin = pastSecondsMin / Params().TargetSpacing();
uint64_t PastBlocksMax = pastSecondsMax / Params().TargetSpacing();
if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || (uint64_t)BlockLastSolved->nHeight < PastBlocksMin) { return Params().ProofOfWorkLimit().GetCompact(); }
for (unsigned int i = 1; BlockReading && BlockReading->nHeight > 0; i++) {
if (PastBlocksMax > 0 && i > PastBlocksMax) { break; }
PastBlocksMass++;
if (i == 1) { PastDifficultyAverage.SetCompact(BlockReading->nBits); }
else { PastDifficultyAverage = ((uint256().SetCompact(BlockReading->nBits) - PastDifficultyAveragePrev) / i) + PastDifficultyAveragePrev; }
PastDifficultyAverage.SetCompact(BlockReading->nBits);
if (i > 1) {
// handle negative uint256
if(PastDifficultyAverage >= PastDifficultyAveragePrev)
PastDifficultyAverage = ((PastDifficultyAverage - PastDifficultyAveragePrev) / i) + PastDifficultyAveragePrev;
else
PastDifficultyAverage = PastDifficultyAveragePrev - ((PastDifficultyAveragePrev - PastDifficultyAverage) / i);
}
PastDifficultyAveragePrev = PastDifficultyAverage;
PastRateActualSeconds = BlockLastSolved->GetBlockTime() - BlockReading->GetBlockTime();
@ -48,7 +59,8 @@ unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const CBloc
EventHorizonDeviationSlow = 1 / EventHorizonDeviation;
if (PastBlocksMass >= PastBlocksMin) {
if ((PastRateAdjustmentRatio <= EventHorizonDeviationSlow) || (PastRateAdjustmentRatio >= EventHorizonDeviationFast)) { assert(BlockReading); break; }
if ((PastRateAdjustmentRatio <= EventHorizonDeviationSlow) || (PastRateAdjustmentRatio >= EventHorizonDeviationFast))
{ assert(BlockReading); break; }
}
if (BlockReading->pprev == NULL) { assert(BlockReading); break; }
BlockReading = BlockReading->pprev;
@ -67,7 +79,7 @@ unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const CBloc
return bnNew.GetCompact();
}
unsigned int static DarkGravityWave(const CBlockIndex* pindexLast, const CBlockHeader *pblock) {
unsigned int static DarkGravityWave(const CBlockIndex* pindexLast) {
/* current difficulty formula, dash - DarkGravity v3, written by Evan Duffield - evan@dashpay.io */
const CBlockIndex *BlockLastSolved = pindexLast;
const CBlockIndex *BlockReading = pindexLast;
@ -151,7 +163,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
if (Params().AllowMinDifficultyBlocks())
{
// Special difficulty rule for testnet:
// If the new block's timestamp is more than 2* 10 minutes
// If the new block's timestamp is more than 2* 2.5 minutes
// then allow mining of a min-difficulty block.
if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + Params().TargetSpacing()*2)
return nProofOfWorkLimit;
@ -167,7 +179,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
return pindexLast->nBits;
}
// Go back by what we want to be 14 days worth of blocks
// Go back by what we want to be 1 day worth of blocks
const CBlockIndex* pindexFirst = pindexLast;
for (int i = 0; pindexFirst && i < Params().Interval()-1; i++)
pindexFirst = pindexFirst->pprev;
@ -193,7 +205,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
bnNew = Params().ProofOfWorkLimit();
/// debug print
LogPrintf("GetNextWorkRequired RETARGET\n");
LogPrintf("GetNextWorkRequired RETARGET at %d\n", pindexLast->nHeight + 1);
LogPrintf("Params().TargetTimespan() = %d nActualTimespan = %d\n", Params().TargetTimespan(), nActualTimespan);
LogPrintf("Before: %08x %s\n", pindexLast->nBits, bnOld.ToString());
LogPrintf("After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString());
@ -205,21 +217,16 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
// Retarget using Kimoto Gravity Wave
else if (retarget == DIFF_KGW)
{
uint64_t pastSecondsMin = Params().TargetTimespan() * 0.025;
uint64_t pastSecondsMax = Params().TargetTimespan() * 7;
uint64_t pastBlocksMin = pastSecondsMin / Params().TargetSpacing();
uint64_t pastBlocksMax = pastSecondsMax / Params().TargetSpacing();
return KimotoGravityWell(pindexLast, pblock, pastBlocksMin, pastBlocksMax);
return KimotoGravityWell(pindexLast);
}
// Retarget using Dark Gravity Wave 3
else if (retarget == DIFF_DGW)
{
return DarkGravityWave(pindexLast, pblock);
return DarkGravityWave(pindexLast);
}
return DarkGravityWave(pindexLast, pblock);
return DarkGravityWave(pindexLast);
}
bool CheckProofOfWork(uint256 hash, unsigned int nBits)

View File

@ -313,6 +313,14 @@ void OverviewPage::updateDarksendProgress()
ui->darksendProgress->setValue(0);
QString s(tr("No inputs detected"));
ui->darksendProgress->setToolTip(s);
// when balance is zero just show info from settings
QString strSettings = BitcoinUnits::formatWithUnit(
walletModel->getOptionsModel()->getDisplayUnit(),
nAnonymizeDarkcoinAmount * COIN
) + " / " + tr("%n Rounds", "", nDarksendRounds);
ui->labelAmountRounds->setText(strSettings);
return;
}
@ -324,11 +332,10 @@ void OverviewPage::updateDarksendProgress()
return;
}
//Get the anon threshold
int64_t nMaxToAnonymize = nAnonymizeDarkcoinAmount*COIN;
int64_t nMaxToAnonymize = pwalletMain->GetAnonymizableBalance(true);
// If it's more than the wallet amount, limit to that.
if(nMaxToAnonymize > nBalance) nMaxToAnonymize = nBalance;
// If it's more than the anon threshold, limit to that.
if(nMaxToAnonymize > nAnonymizeDarkcoinAmount*COIN) nMaxToAnonymize = nAnonymizeDarkcoinAmount*COIN;
if(nMaxToAnonymize == 0) return;
@ -340,7 +347,6 @@ void OverviewPage::updateDarksendProgress()
{
denomPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / denominatedBalance;
denomPart = denomPart > 1 ? 1 : denomPart;
if(denomPart == 1 && nMaxToAnonymize > denominatedBalance) nMaxToAnonymize = denominatedBalance;
}
// % of fully anonymized balance
@ -360,6 +366,36 @@ void OverviewPage::updateDarksendProgress()
QString strToolPip = tr("Progress: %1% (inputs have an average of %2 of %n rounds)", "", nDarksendRounds).arg(progress).arg(pwalletMain->GetAverageAnonymizedRounds());
ui->darksendProgress->setToolTip(strToolPip);
QString strSettings;
if(nMaxToAnonymize >= nAnonymizeDarkcoinAmount * COIN) {
ui->labelAmountRounds->setToolTip(tr("Found enough compatible inputs to anonymize %1")
.arg(BitcoinUnits::formatWithUnit(
walletModel->getOptionsModel()->getDisplayUnit(),
nAnonymizeDarkcoinAmount * COIN
)));
strSettings = BitcoinUnits::formatWithUnit(
walletModel->getOptionsModel()->getDisplayUnit(),
nAnonymizeDarkcoinAmount * COIN
) + " / " + tr("%n Rounds", "", nDarksendRounds);
} else {
ui->labelAmountRounds->setToolTip(tr("Not enough compatible inputs to anonymize <span style='color:red;'>%1</span>,<br/>"
"will anonymize <span style='color:red;'>%2</span> instead")
.arg(BitcoinUnits::formatWithUnit(
walletModel->getOptionsModel()->getDisplayUnit(),
nAnonymizeDarkcoinAmount * COIN
))
.arg(BitcoinUnits::formatWithUnit(
walletModel->getOptionsModel()->getDisplayUnit(),
nMaxToAnonymize
)));
strSettings = "<span style='color:red;'>" + BitcoinUnits::formatWithUnit(
walletModel->getOptionsModel()->getDisplayUnit(),
nMaxToAnonymize
) + " / " + tr("%n Rounds", "", nDarksendRounds) + "</span>";
}
ui->labelAmountRounds->setText(strSettings);
}
@ -374,13 +410,6 @@ void OverviewPage::darkSendStatus()
lastNewBlock = GetTime();
updateDarksendProgress();
QString strSettings = BitcoinUnits::formatWithUnit(
walletModel->getOptionsModel()->getDisplayUnit(),
nAnonymizeDarkcoinAmount * COIN
) + " / " + tr("%n Rounds", "", nDarksendRounds);
ui->labelAmountRounds->setText(strSettings);
}
if(!fEnableDarksend) {

View File

@ -1,39 +0,0 @@
IDI_ICON1 ICON DISCARDABLE "icons/bitcoin.ico"
IDI_ICON2 ICON DISCARDABLE "icons/bitcoin_testnet.ico"
#include <windows.h> // needed for VERSIONINFO
#include "../../clientversion.h" // holds the needed client version information
#define VER_PRODUCTVERSION CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION,CLIENT_VERSION_BUILD
#define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD)
#define VER_FILEVERSION VER_PRODUCTVERSION
#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin and Dash developers"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Dash"
VALUE "FileDescription", "Dash Core (OSS GUI client for Dash)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "dash-qt"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "dash-qt.exe"
VALUE "ProductName", "Dash Core"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal)
END
END

View File

@ -1,6 +1,6 @@
all:
$(MAKE) -C .. bitcoin_test
$(MAKE) -C .. dash_test
clean:
$(MAKE) -C .. bitcoin_test_clean
$(MAKE) -C .. dash_test_clean
check:
$(MAKE) -C .. bitcoin_test_check
$(MAKE) -C .. dash_test_check

View File

@ -1172,6 +1172,40 @@ CAmount CWallet::GetBalance() const
return nTotal;
}
CAmount CWallet::GetAnonymizableBalance(bool includeAlreadyAnonymized) const
{
if(fLiteMode) return 0;
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsTrusted())
{
uint256 hash = (*it).first;
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
{
CTxIn vin = CTxIn(hash, i);
if(IsSpent(hash, i) || !IsMine(pcoin->vout[i])) continue;
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0) continue; // do not count immature
if(pcoin->vout[i].nValue == 1000*COIN) continue; // do not count MN-like outputs
int rounds = GetInputDarksendRounds(vin);
if(rounds >=-2 && (rounds < nDarksendRounds || (includeAlreadyAnonymized && rounds >= nDarksendRounds))) {
nTotal += pcoin->vout[i].nValue;
}
}
}
}
}
return nTotal;
}
CAmount CWallet::GetAnonymizedBalance() const
{
if(fLiteMode) return 0;
@ -1268,7 +1302,7 @@ CAmount CWallet::GetNormalizedAnonymizedBalance() const
return nTotal;
}
CAmount CWallet::GetDenominatedBalance(bool onlyDenom, bool onlyUnconfirmed) const
CAmount CWallet::GetDenominatedBalance(bool onlyDenom, bool onlyUnconfirmed, bool includeAlreadyAnonymized) const
{
CAmount nTotal = 0;
{
@ -1292,6 +1326,10 @@ CAmount CWallet::GetDenominatedBalance(bool onlyDenom, bool onlyUnconfirmed) con
if(!IsMine(pcoin->vout[i])) continue;
if(onlyDenom != IsDenominatedAmount(pcoin->vout[i].nValue)) continue;
CTxIn vin = CTxIn(hash, i);
int rounds = GetInputDarksendRounds(vin);
if(!includeAlreadyAnonymized && rounds >= nDarksendRounds) continue;
nTotal += pcoin->vout[i].nValue;
}
}
@ -1749,7 +1787,7 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t
return (nValueRet >= nValueMin && fFound100 && fFound10 && fFound1 && fFoundDot1);
}
bool CWallet::SelectCoinsDark(int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& setCoinsRet, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) const
bool CWallet::SelectCoinsDark(CAmount nValueMin, CAmount nValueMax, std::vector<CTxIn>& setCoinsRet, CAmount& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) const
{
CCoinControl *coinControl=NULL;
@ -1766,8 +1804,10 @@ bool CWallet::SelectCoinsDark(int64_t nValueMin, int64_t nValueMax, std::vector<
BOOST_FOREACH(const COutput& out, vCoins)
{
//there's no reason to allow inputs less than 1 COIN into DS (other than denominations smaller than that amount)
if(out.tx->vout[out.i].nValue < 1*COIN && !IsDenominatedAmount(out.tx->vout[out.i].nValue)) continue;
//do not allow inputs less than 1 CENT
if(out.tx->vout[out.i].nValue < CENT) continue;
//do not allow collaterals to be selected
if(IsCollateralAmount(out.tx->vout[out.i].nValue)) continue;
if(fMasterNode && out.tx->vout[out.i].nValue == 1000*COIN) continue; //masternode input
if(nValueRet + out.tx->vout[out.i].nValue <= nValueMax){

View File

@ -310,10 +310,11 @@ public:
CAmount GetBalance() const;
CAmount GetUnconfirmedBalance() const;
CAmount GetImmatureBalance() const;
CAmount GetAnonymizableBalance(bool includeAlreadyAnonymized=false) const;
CAmount GetAnonymizedBalance() const;
double GetAverageAnonymizedRounds() const;
CAmount GetNormalizedAnonymizedBalance() const;
CAmount GetDenominatedBalance(bool onlyDenom=true, bool onlyUnconfirmed=false) const;
CAmount GetDenominatedBalance(bool onlyDenom=true, bool onlyUnconfirmed=false, bool includeAlreadyAnonymized = true) const;
CAmount GetWatchOnlyBalance() const;
CAmount GetUnconfirmedWatchOnlyBalance() const;
CAmount GetImmatureWatchOnlyBalance() const;