aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--Makefile.am40
-rw-r--r--build-aux/m4/bitcoin_find_bdb48.m44
-rw-r--r--build-aux/m4/bitcoin_qt.m42
-rw-r--r--configure.ac66
-rw-r--r--contrib/gitian-descriptors/gitian-osx-signer.yml3
-rw-r--r--contrib/gitian-descriptors/gitian-osx.yml13
-rw-r--r--contrib/macdeploy/Base.lproj/InfoPlist.strings1
-rw-r--r--contrib/macdeploy/DS_Storebin10244 -> 0 bytes
-rw-r--r--contrib/macdeploy/background.pngbin48690 -> 0 bytes
-rw-r--r--contrib/macdeploy/background.psdbin982442 -> 0 bytes
-rw-r--r--contrib/macdeploy/background.svg34
-rw-r--r--contrib/macdeploy/background.tiffbin202136 -> 0 bytes
-rw-r--r--contrib/macdeploy/background@2x.pngbin138890 -> 0 bytes
-rwxr-xr-xcontrib/macdeploy/custom_dsstore.py60
-rwxr-xr-xcontrib/macdeploy/macdeployqtplus14
-rw-r--r--depends/config.site.in1
-rw-r--r--depends/packages/native_biplist.mk15
-rw-r--r--depends/packages/native_ds_store.mk17
-rw-r--r--depends/packages/native_mac_alias.mk16
-rw-r--r--depends/packages/packages.mk4
-rw-r--r--doc/README_osx.txt5
-rw-r--r--doc/build-unix.md1
-rw-r--r--doc/release-process.md20
-rw-r--r--libbitcoinconsensus.pc.in2
-rwxr-xr-xqa/rpc-tests/test_framework/mininode.py2
-rw-r--r--share/qt/Info.plist.in2
-rwxr-xr-xshare/qt/extract_strings_qt.py4
-rw-r--r--share/setup.nsi.in6
-rw-r--r--src/Makefile.am104
-rw-r--r--src/Makefile.bench.include5
-rw-r--r--src/Makefile.qt.include4
-rw-r--r--src/Makefile.qttest.include2
-rw-r--r--src/Makefile.test.include5
-rw-r--r--src/bitcoin-cli-res.rc2
-rw-r--r--src/bitcoin-cli.cpp8
-rw-r--r--src/bitcoin-tx.cpp6
-rw-r--r--src/bitcoind.cpp11
-rw-r--r--src/clientversion.h2
-rw-r--r--src/httprpc.cpp5
-rw-r--r--src/init.cpp33
-rw-r--r--src/main.cpp41
-rw-r--r--src/main.h32
-rw-r--r--src/net.cpp11
-rw-r--r--src/net.h2
-rw-r--r--src/pow.cpp12
-rw-r--r--src/qt/askpassphrasedialog.cpp8
-rw-r--r--src/qt/bitcoin.cpp8
-rw-r--r--src/qt/bitcoingui.cpp16
-rw-r--r--src/qt/forms/debugwindow.ui2
-rw-r--r--src/qt/forms/helpmessagedialog.ui3
-rw-r--r--src/qt/forms/intro.ui10
-rw-r--r--src/qt/forms/optionsdialog.ui6
-rw-r--r--src/qt/intro.cpp10
-rw-r--r--src/qt/optionsdialog.cpp5
-rw-r--r--src/qt/res/bitcoin-qt-res.rc4
-rw-r--r--src/qt/rpcconsole.cpp8
-rw-r--r--src/qt/splashscreen.cpp24
-rw-r--r--src/qt/utilitydialog.cpp12
-rw-r--r--src/rpc/mining.cpp2
-rw-r--r--src/rpc/rawtransaction.cpp8
-rw-r--r--src/test/checkblock_tests.cpp66
-rw-r--r--src/test/txvalidationcache_tests.cpp2
-rw-r--r--src/test/util_tests.cpp21
-rw-r--r--src/timedata.cpp6
-rw-r--r--src/util.cpp11
-rw-r--r--src/util.h2
-rw-r--r--src/utilstrencodings.cpp56
-rw-r--r--src/validationinterface.cpp8
-rw-r--r--src/validationinterface.h7
-rw-r--r--src/wallet/wallet.cpp27
-rw-r--r--src/wallet/wallet.h6
-rw-r--r--src/zmq/zmqnotificationinterface.cpp2
-rw-r--r--src/zmq/zmqnotificationinterface.h2
74 files changed, 623 insertions, 338 deletions
diff --git a/.travis.yml b/.travis.yml
index 71cee99254..54ae74fd3c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -41,7 +41,7 @@ matrix:
- compiler: ": No wallet"
env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
- compiler: ": Cross-Mac"
- env: HOST=x86_64-apple-darwin11 PACKAGES="cmake libcap-dev libz-dev libbz2-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy"
+ env: HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy"
exclude:
- compiler: gcc
install:
diff --git a/Makefile.am b/Makefile.am
index 0a3b00bcc7..d6cbd7cb12 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,7 @@ SUBDIRS = src
.PHONY: deploy FORCE
GZIP_ENV="-9n"
+export PYTHONPATH
if BUILD_BITCOIN_LIBS
pkgconfigdir = $(libdir)/pkgconfig
@@ -14,12 +15,18 @@ BITCOIN_QT_BIN=$(top_builddir)/src/qt/bitcoin-qt$(EXEEXT)
BITCOIN_CLI_BIN=$(top_builddir)/src/bitcoin-cli$(EXEEXT)
BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
+empty :=
+space := $(empty) $(empty)
+
OSX_APP=Bitcoin-Qt.app
-OSX_DMG=Bitcoin-Core.dmg
+OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
+OSX_DMG = $(OSX_VOLNAME).dmg
+OSX_BACKGROUND_SVG=background.svg
OSX_BACKGROUND_IMAGE=background.tiff
+OSX_BACKGROUND_IMAGE_DPIS=36 72
+OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
-OSX_BASE_LPROJ_DIR=$(top_srcdir)/contrib/macdeploy/Base.lproj/InfoPlist.strings
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
@@ -34,9 +41,9 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
$(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
$(top_srcdir)/doc/README_windows.txt
-OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) $(OSX_BASE_LPROJ_DIR) \
- $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \
- $(top_srcdir)/contrib/macdeploy/DS_Store \
+OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
+ $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
+ $(OSX_DSSTORE_GEN) \
$(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
@@ -90,17 +97,20 @@ $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
$(MKDIR_P) $(@D)
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@
-$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: $(OSX_BASE_LPROJ_DIR)
+$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
$(MKDIR_P) $(@D)
- $(INSTALL_DATA) $< $@
+ echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
$(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
$(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
+osx_volname:
+ echo $(OSX_VOLNAME) >$@
+
if BUILD_DARWIN
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
- $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
+ $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME)
deploydir: $(OSX_DMG)
else
@@ -114,13 +124,17 @@ $(APP_DIST_DIR)/Applications:
$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
$(OSX_DMG): $(APP_DIST_EXTRAS)
- $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Bitcoin-Core" -no-pad -r -dir-mode 0755 -apple -o $@ dist
+ $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
-$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_IMAGE)
+dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
+ sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
+OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
+$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
$(MKDIR_P) $(@D)
- $(INSTALL) $< $@
-$(APP_DIST_DIR)/.DS_Store: contrib/macdeploy/DS_Store
- $(INSTALL) $< $@
+ $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
+
+$(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
+ $< "$@" "$(OSX_VOLNAME)"
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2
diff --git a/build-aux/m4/bitcoin_find_bdb48.m4 b/build-aux/m4/bitcoin_find_bdb48.m4
index 0bf558d25b..2aa493a6af 100644
--- a/build-aux/m4/bitcoin_find_bdb48.m4
+++ b/build-aux/m4/bitcoin_find_bdb48.m4
@@ -38,7 +38,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
done
if test "x$bdbpath" = "xX"; then
AC_MSG_RESULT([no])
- AC_MSG_ERROR([libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])
+ AC_MSG_ERROR([libdb_cxx headers missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])
elif test "x$bdb48path" = "xX"; then
BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdbpath}],db_cxx)
AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 4.8])],[
@@ -60,7 +60,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
])
done
if test "x$BDB_LIBS" = "x"; then
- AC_MSG_ERROR([libdb_cxx missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])
+ AC_MSG_ERROR([libdb_cxx missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])
fi
AC_SUBST(BDB_LIBS)
])
diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4
index 2480267dc1..5fe12fda9b 100644
--- a/build-aux/m4/bitcoin_qt.m4
+++ b/build-aux/m4/bitcoin_qt.m4
@@ -220,7 +220,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
dnl enable qt support
- AC_MSG_CHECKING(whether to build Bitcoin Core GUI)
+ AC_MSG_CHECKING(whether to build ]AC_PACKAGE_NAME[ GUI)
BITCOIN_QT_CHECK([
bitcoin_enable_qt=yes
bitcoin_enable_qt_test=yes
diff --git a/configure.ac b/configure.ac
index 921b26a940..939dfeaabf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,9 @@ define(_CLIENT_VERSION_REVISION, 99)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_COPYRIGHT_YEAR, 2016)
-AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin])
+define(_COPYRIGHT_HOLDERS,[The %s developers])
+define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[Bitcoin Core])
+AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://bitcoincore.org/])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
AC_CONFIG_AUX_DIR([build-aux])
@@ -67,6 +69,8 @@ AC_PATH_PROG(HEXDUMP,hexdump)
AC_PATH_TOOL(READELF, readelf)
AC_PATH_TOOL(CPPFILT, c++filt)
+AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)
+
dnl pkg-config check.
PKG_PROG_PKG_CONFIG
@@ -150,6 +154,12 @@ AC_ARG_ENABLE([glibc-back-compat],
[use_glibc_compat=$enableval],
[use_glibc_compat=no])
+AC_ARG_WITH([system-univalue],
+ [AS_HELP_STRING([--with-system-univalue],
+ [Build with system UniValue (default is no)])],
+ [system_univalue=$withval],
+ [system_univalue=no]
+)
AC_ARG_ENABLE([zmq],
[AS_HELP_STRING([--disable-zmq],
[disable ZMQ notifications])],
@@ -316,6 +326,9 @@ case $host in
AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
AC_PATH_TOOL([OTOOL], [otool], otool)
AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)
+ AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
+ AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert)
+ AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp)
dnl libtool will try to strip the static lib, which is a problem for
dnl cross-builds because strip attempts to call a hard-coded ld,
@@ -783,6 +796,44 @@ else
fi
fi
+dnl univalue check
+
+if test x$system_univalue != xno ; then
+ found_univalue=no
+ if test x$use_pkgconfig = xyes; then
+ : #NOP
+ m4_ifdef(
+ [PKG_CHECK_MODULES],
+ [
+ PKG_CHECK_MODULES([UNIVALUE],[libunivalue],[found_univalue=yes],[true])
+ ]
+ )
+ else
+ AC_CHECK_HEADER([univalue.h],[
+ AC_CHECK_LIB([univalue], [main],[
+ UNIVALUE_LIBS=-lunivalue
+ found_univalue=yes
+ ],[true])
+ ],[true])
+ fi
+
+ if test x$found_univalue = xyes ; then
+ system_univalue=yes
+ elif test x$system_univalue = xyes ; then
+ AC_MSG_ERROR([univalue not found])
+ else
+ system_univalue=no
+ fi
+fi
+
+if test x$system_univalue = xno ; then
+ UNIVALUE_CFLAGS='-I$(srcdir)/univalue/include'
+ UNIVALUE_LIBS='univalue/libunivalue.la'
+fi
+AM_CONDITIONAL([EMBEDDED_UNIVALUE],[test x$system_univalue = xno])
+AC_SUBST(UNIVALUE_CFLAGS)
+AC_SUBST(UNIVALUE_LIBS)
+
CXXFLAGS_TEMP="$CXXFLAGS"
LIBS_TEMP="$LIBS"
CXXFLAGS="$CXXFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS"
@@ -949,12 +1000,19 @@ AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision])
AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])
AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])
AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release])
+AC_DEFINE(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS", [Copyright holder(s) before %s replacement])
+AC_DEFINE(COPYRIGHT_HOLDERS_SUBSTITUTION, "_COPYRIGHT_HOLDERS_SUBSTITUTION", [Replacement for %s in copyright holders string])
+define(_COPYRIGHT_HOLDERS_FINAL, patsubst(_COPYRIGHT_HOLDERS, [%s], [_COPYRIGHT_HOLDERS_SUBSTITUTION]))
+AC_DEFINE(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL", [Copyright holder(s)])
AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)
AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)
AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)
AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD)
AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)
AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
+AC_SUBST(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS")
+AC_SUBST(COPYRIGHT_HOLDERS_SUBSTITUTION, "_COPYRIGHT_HOLDERS_SUBSTITUTION")
+AC_SUBST(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL")
AC_SUBST(RELDFLAGS)
AC_SUBST(HARDENED_CXXFLAGS)
@@ -1000,8 +1058,12 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
unset PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
+if test x$system_univalue = xno; then
+ AC_CONFIG_SUBDIRS([src/univalue])
+fi
+
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery"
-AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue])
+AC_CONFIG_SUBDIRS([src/secp256k1])
AC_OUTPUT
diff --git a/contrib/gitian-descriptors/gitian-osx-signer.yml b/contrib/gitian-descriptors/gitian-osx-signer.yml
index 4c4e3ff827..c4165470af 100644
--- a/contrib/gitian-descriptors/gitian-osx-signer.yml
+++ b/contrib/gitian-descriptors/gitian-osx-signer.yml
@@ -32,6 +32,7 @@ script: |
SIGNED=bitcoin-osx-signed.dmg
tar -xf ${UNSIGNED}
+ OSX_VOLNAME="$(cat osx_volname)"
./detached-sig-apply.sh ${UNSIGNED} signature/osx
- ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "Bitcoin-Core" -no-pad -r -apple -o uncompressed.dmg signed-app
+ ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "${OSX_VOLNAME}" -no-pad -r -apple -o uncompressed.dmg signed-app
${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED}
diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml
index c2d8b9baaa..4a4592398b 100644
--- a/contrib/gitian-descriptors/gitian-osx.yml
+++ b/contrib/gitian-descriptors/gitian-osx.yml
@@ -6,20 +6,26 @@ suites:
architectures:
- "amd64"
packages:
+- "ca-certificates"
- "g++"
- "git-core"
- "pkg-config"
- "autoconf"
+- "librsvg2-bin"
+- "libtiff-tools"
- "libtool"
- "automake"
- "faketime"
- "bsdmainutils"
- "cmake"
+- "imagemagick"
- "libcap-dev"
- "libz-dev"
- "libbz2-dev"
-- "ca-certificates"
- "python"
+- "python-dev"
+- "python-setuptools"
+- "fonts-tuffy"
reference_datetime: "2016-01-01 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
@@ -109,8 +115,11 @@ script: |
make ${MAKEOPTS}
make install-strip
+ make osx_volname
make deploydir
+ OSX_VOLNAME="$(cat osx_volname)"
mkdir -p unsigned-app-${i}
+ cp osx_volname unsigned-app-${i}/
cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
@@ -122,7 +131,7 @@ script: |
popd
make deploy
- ${WRAP_DIR}/dmg dmg Bitcoin-Core.dmg ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg
+ ${WRAP_DIR}/dmg dmg "${OSX_VOLNAME}.dmg" ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg
cd installed
find . -name "lib*.la" -delete
diff --git a/contrib/macdeploy/Base.lproj/InfoPlist.strings b/contrib/macdeploy/Base.lproj/InfoPlist.strings
deleted file mode 100644
index b259ea141c..0000000000
--- a/contrib/macdeploy/Base.lproj/InfoPlist.strings
+++ /dev/null
@@ -1 +0,0 @@
-{ CFBundleDisplayName = "Bitcoin Core"; CFBundleName = "Bitcoin Core"; }
diff --git a/contrib/macdeploy/DS_Store b/contrib/macdeploy/DS_Store
deleted file mode 100644
index db9d16f1d7..0000000000
--- a/contrib/macdeploy/DS_Store
+++ /dev/null
Binary files differ
diff --git a/contrib/macdeploy/background.png b/contrib/macdeploy/background.png
deleted file mode 100644
index f88a2ae74b..0000000000
--- a/contrib/macdeploy/background.png
+++ /dev/null
Binary files differ
diff --git a/contrib/macdeploy/background.psd b/contrib/macdeploy/background.psd
deleted file mode 100644
index fdc4f4ca4a..0000000000
--- a/contrib/macdeploy/background.psd
+++ /dev/null
Binary files differ
diff --git a/contrib/macdeploy/background.svg b/contrib/macdeploy/background.svg
new file mode 100644
index 0000000000..9c330af451
--- /dev/null
+++ b/contrib/macdeploy/background.svg
@@ -0,0 +1,34 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1000pt" height="640pt" viewBox="0 0 1000 640" preserveAspectRatio="xMidYMid meet">
+ <!-- kate: space-indent off;
+ Copyright (c) 2015 The Bitcoin Core developers
+ Distributed under the MIT software license, see the accompanying
+ file COPYING or http://www.opensource.org/licenses/mit-license.php.
+ -->
+ <style type="text/css"><![CDATA[
+ text {
+ font-family: "Tuffy";
+ font-size: 86px;
+ fill: gray;
+ text-anchor: middle;
+ }
+ ]]></style>
+ <defs>
+ <linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%">
+ <stop offset="0%" style="stop-color:rgb(239,239,239);stop-opacity:1" />
+ <stop offset="33%" style="stop-color:rgb(239,239,239);stop-opacity:1" />
+ <stop offset="80%" style="stop-color:rgb(205,205,205);stop-opacity:1" />
+ <stop offset="100%" style="stop-color:rgb(204,204,204);stop-opacity:1" />
+ </linearGradient>
+ </defs>
+ <rect width="1000" height="640" style="fill:url(#gradient);stroke-width:0" />
+ <g transform="translate(500,0) scale(0.9, 1)">
+ <text x="0" y="114">PACKAGE_NAME</text>
+ </g>
+ <g transform="translate(0.000000,640.000000) scale(0.100000,-0.100000)"
+ fill="#000000" stroke="none">
+ <path d="M4995 3705 c-24 -23 -25 -29 -25 -165 l0 -140 -306 0 -306 0 -29 -29 c-29 -29 -29 -31 -29 -141 0 -110 0 -112 29 -141 l29 -29 306 0 306 0 0 -140 c0 -136 1 -142 25 -165 16 -17 35 -25 57 -25 29 0 72 32 306 226 180 149 274 233 278 250 13 53 -2 70 -278 299 -235 194 -277 225 -306 225 -22 0 -41 -8 -57 -25z" fixlter="url(#glow)"/>
+ </g>
+</svg>
diff --git a/contrib/macdeploy/background.tiff b/contrib/macdeploy/background.tiff
deleted file mode 100644
index 4b44ac672e..0000000000
--- a/contrib/macdeploy/background.tiff
+++ /dev/null
Binary files differ
diff --git a/contrib/macdeploy/background@2x.png b/contrib/macdeploy/background@2x.png
deleted file mode 100644
index 4858183f75..0000000000
--- a/contrib/macdeploy/background@2x.png
+++ /dev/null
Binary files differ
diff --git a/contrib/macdeploy/custom_dsstore.py b/contrib/macdeploy/custom_dsstore.py
new file mode 100755
index 0000000000..8481e903a0
--- /dev/null
+++ b/contrib/macdeploy/custom_dsstore.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+# Copyright (c) 2013-2015 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+import biplist
+from ds_store import DSStore
+from mac_alias import Alias
+import sys
+
+output_file = sys.argv[1]
+package_name_ns = sys.argv[2]
+
+ds = DSStore.open(output_file, 'w+')
+ds['.']['bwsp'] = {
+ 'ShowStatusBar': False,
+ 'WindowBounds': '{{300, 280}, {500, 343}}',
+ 'ContainerShowSidebar': False,
+ 'SidebarWidth': 0,
+ 'ShowTabView': False,
+ 'PreviewPaneVisibility': False,
+ 'ShowToolbar': False,
+ 'ShowSidebar': False,
+ 'ShowPathbar': True
+}
+
+icvp = {
+ 'gridOffsetX': 0.0,
+ 'textSize': 12.0,
+ 'viewOptionsVersion': 1,
+ 'backgroundImageAlias': '\x00\x00\x00\x00\x02\x1e\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x94\\\xb0H+\x00\x05\x00\x00\x00\x98\x0fbackground.tiff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\xd19\xb0\xf8\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\r\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b.background\x00\x00\x10\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x11\x00\x08\x00\x00\xd19\xb0\xf8\x00\x00\x00\x01\x00\x04\x00\x00\x00\x98\x00\x0e\x00 \x00\x0f\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\x00.\x00t\x00i\x00f\x00f\x00\x0f\x00\x02\x00\x00\x00\x12\x00\x1c/.background/background.tiff\x00\x14\x01\x06\x00\x00\x00\x00\x01\x06\x00\x02\x00\x00\x0cMacintosh HD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x97\xab\xc3H+\x00\x00\x01\x88[\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02u\xab\x8d\xd1\x94\\\xb0devrddsk\xff\xff\xff\xff\x00\x00\t \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07bitcoin\x00\x00\x10\x00\x08\x00\x00\xce\x97\xab\xc3\x00\x00\x00\x11\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x01\x00\x14\x01\x88[\x88\x00\x16\xa9\t\x00\x08\xfaR\x00\x08\xfaQ\x00\x02d\x8e\x00\x0e\x00\x02\x00\x00\x00\x0f\x00\x1a\x00\x0c\x00M\x00a\x00c\x00i\x00n\x00t\x00o\x00s\x00h\x00 \x00H\x00D\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x14\xff\xff\x00\x00\xff\xff\x00\x00',
+ 'backgroundColorBlue': 1.0,
+ 'iconSize': 96.0,
+ 'backgroundColorGreen': 1.0,
+ 'arrangeBy': 'none',
+ 'showIconPreview': True,
+ 'gridSpacing': 100.0,
+ 'gridOffsetY': 0.0,
+ 'showItemInfo': False,
+ 'labelOnBottom': True,
+ 'backgroundType': 2,
+ 'backgroundColorRed': 1.0
+}
+alias = Alias.from_bytes(icvp['backgroundImageAlias'])
+alias.volume.name = package_name_ns
+alias.volume.posix_path = '/Volumes/' + package_name_ns
+alias.volume.disk_image_alias.target.filename = package_name_ns + '.temp.dmg'
+alias.volume.disk_image_alias.target.carbon_path = 'Macintosh HD:Users:\x00bitcoinuser:\x00Documents:\x00bitcoin:\x00bitcoin:\x00' + package_name_ns + '.temp.dmg'
+alias.volume.disk_image_alias.target.posix_path = 'Users/bitcoinuser/Documents/bitcoin/bitcoin/' + package_name_ns + '.temp.dmg'
+alias.target.carbon_path = package_name_ns + ':.background:\x00background.tiff'
+icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes())
+ds['.']['icvp'] = icvp
+
+ds['.']['vSrn'] = ('long', 1)
+
+ds['Applications']['Iloc'] = (370, 156)
+ds['Bitcoin-Qt.app']['Iloc'] = (128, 156)
+
+ds.flush()
+ds.close()
diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus
index 2253c40af1..7e6270c743 100755
--- a/contrib/macdeploy/macdeployqtplus
+++ b/contrib/macdeploy/macdeployqtplus
@@ -495,6 +495,7 @@ ap.add_argument("-fancy", nargs=1, metavar="plist", default=[], help="make a fan
ap.add_argument("-add-qt-tr", nargs=1, metavar="languages", default=[], help="add Qt translation files to the bundle's ressources; the language list must be separated with commas, not with whitespace")
ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translation files")
ap.add_argument("-add-resources", nargs="+", metavar="path", default=[], help="list of additional files or folders to be copied into the bundle's resources; must be the last argument")
+ap.add_argument("-volname", nargs=1, metavar="volname", default=[], help="custom volume name for dmg")
config = ap.parse_args()
@@ -596,6 +597,13 @@ if os.path.exists("dist"):
# ------------------------------------------------
+if len(config.volname) == 1:
+ volname = config.volname[0]
+else:
+ volname = app_bundle_name
+
+# ------------------------------------------------
+
target = os.path.join("dist", "Bitcoin-Qt.app")
if verbose >= 2:
@@ -757,7 +765,7 @@ if config.dmg is not None:
if fancy is None:
try:
- runHDIUtil("create", dmg_name, srcfolder="dist", format="UDBZ", volname="Bitcoin-Core", ov=True)
+ runHDIUtil("create", dmg_name, srcfolder="dist", format="UDBZ", volname=volname, ov=True)
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)
else:
@@ -772,7 +780,7 @@ if config.dmg is not None:
if verbose >= 3:
print "Creating temp image for modification..."
try:
- runHDIUtil("create", dmg_name + ".temp", srcfolder="dist", format="UDRW", size=size, volname="Bitcoin-Core", ov=True)
+ runHDIUtil("create", dmg_name + ".temp", srcfolder="dist", format="UDRW", size=size, volname=volname, ov=True)
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)
@@ -837,7 +845,7 @@ if config.dmg is not None:
items_positions.append(itemscript.substitute(params))
params = {
- "disk" : "Bitcoin-Core",
+ "disk" : volname,
"window_bounds" : "300,300,800,620",
"icon_size" : "96",
"background_commands" : "",
diff --git a/depends/config.site.in b/depends/config.site.in
index 873f66018d..984ddb1e62 100644
--- a/depends/config.site.in
+++ b/depends/config.site.in
@@ -66,6 +66,7 @@ CXX="@CXX@"
OBJC="${CC}"
OBJCXX="${CXX}"
CCACHE=$prefix/native/bin/ccache
+PYTHONPATH=$prefix/native/lib/python/dist-packages:$PYTHONPATH
if test -n "@AR@"; then
AR=@AR@
diff --git a/depends/packages/native_biplist.mk b/depends/packages/native_biplist.mk
new file mode 100644
index 0000000000..eb8672d556
--- /dev/null
+++ b/depends/packages/native_biplist.mk
@@ -0,0 +1,15 @@
+package=native_biplist
+$(package)_version=0.9
+$(package)_download_path=https://pypi.python.org/packages/source/b/biplist
+$(package)_file_name=biplist-$($(package)_version).tar.gz
+$(package)_sha256_hash=b57cadfd26e4754efdf89e9e37de87885f9b5c847b2615688ca04adfaf6ca604
+$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
+
+define $(package)_build_cmds
+ python setup.py build
+endef
+
+define $(package)_stage_cmds
+ mkdir -p $($(package)_install_libdir) && \
+ python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir)
+endef
diff --git a/depends/packages/native_ds_store.mk b/depends/packages/native_ds_store.mk
new file mode 100644
index 0000000000..8e902af1b6
--- /dev/null
+++ b/depends/packages/native_ds_store.mk
@@ -0,0 +1,17 @@
+package=native_ds_store
+$(package)_version=c80c23706eae
+$(package)_download_path=https://bitbucket.org/al45tair/ds_store/get
+$(package)_download_file=$($(package)_version).tar.bz2
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=ce1aa412211610c63d567bbe3e06213006a2d5ba5d76d89399c151b5472cb0da
+$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
+$(package)_dependencies=native_biplist
+
+define $(package)_build_cmds
+ python setup.py build
+endef
+
+define $(package)_stage_cmds
+ mkdir -p $($(package)_install_libdir) && \
+ python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir)
+endef
diff --git a/depends/packages/native_mac_alias.mk b/depends/packages/native_mac_alias.mk
new file mode 100644
index 0000000000..d117c1c9a3
--- /dev/null
+++ b/depends/packages/native_mac_alias.mk
@@ -0,0 +1,16 @@
+package=native_mac_alias
+$(package)_version=1.1.0
+$(package)_download_path=https://bitbucket.org/al45tair/mac_alias/get
+$(package)_download_file=v$($(package)_version).tar.bz2
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=87ad827e66790028361e43fc754f68ed041a9bdb214cca03c853f079b04fb120
+$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
+
+define $(package)_build_cmds
+ python setup.py build
+endef
+
+define $(package)_stage_cmds
+ mkdir -p $($(package)_install_libdir) && \
+ python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir)
+endef
diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk
index 02cc188420..59b009b66a 100644
--- a/depends/packages/packages.mk
+++ b/depends/packages/packages.mk
@@ -15,6 +15,8 @@ wallet_packages=bdb
upnp_packages=miniupnpc
+darwin_native_packages = native_biplist native_ds_store native_mac_alias
+
ifneq ($(build_os),darwin)
-darwin_native_packages=native_cctools native_cdrkit native_libdmg-hfsplus
+darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus
endif
diff --git a/doc/README_osx.txt b/doc/README_osx.txt
index f589bfc676..c13efaa145 100644
--- a/doc/README_osx.txt
+++ b/doc/README_osx.txt
@@ -63,9 +63,8 @@ functionality is broken. Only the compression feature is currently used.
Ideally, the creation could be fixed and genisoimage would no longer be necessary.
Background images and other features can be added to DMG files by inserting a
-.DS_Store before creation. The easiest way to create this file is to build a
-DMG without one, move it to a device running OS X, customize the layout, then
-grab the .DS_Store file for later use. That is the approach taken here.
+.DS_Store before creation. This is generated by the script
+contrib/macdeploy/custom_dsstore.py.
As of OS X Mavericks (10.9), using an Apple-blessed key to sign binaries is a
requirement in order to satisfy the new Gatekeeper requirements. Because this
diff --git a/doc/build-unix.md b/doc/build-unix.md
index 60c9d57b0a..96de098c38 100644
--- a/doc/build-unix.md
+++ b/doc/build-unix.md
@@ -46,6 +46,7 @@ Optional dependencies:
qt | GUI | GUI toolkit (only needed when GUI enabled)
protobuf | Payments in GUI | Data interchange format used for payment protocol (only needed when GUI enabled)
libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled)
+ univalue | Utility | JSON parsing and encoding (bundled version will be used unless --with-system-univalue passed to configure)
libzmq3 | ZMQ notification | Optional, allows generating ZMQ notifications (requires ZMQ version >= 4.x)
For the versions used in the release, see [release-process.md](release-process.md) under *Fetch and build inputs*.
diff --git a/doc/release-process.md b/doc/release-process.md
index 39e3032a67..8fb083d0d4 100644
--- a/doc/release-process.md
+++ b/doc/release-process.md
@@ -3,6 +3,7 @@ Release Process
* Update translations (ping wumpus, Diapolo or tcatm on IRC) see [translation_process.md](https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md#syncing-with-transifex)
* Update [bips.md](bips.md) to account for changes since the last release.
+* Update hardcoded [seeds](/contrib/seeds)
* * *
@@ -19,8 +20,10 @@ Check out the source code in the following directory hierarchy.
pushd ./bitcoin
contrib/verifysfbinaries/verify.sh
+ configure.ac
doc/README*
- share/setup.nsi
+ doc/Doxyfile
+ contrib/gitian-descriptors/*.yml
src/clientversion.h (change CLIENT_VERSION_IS_RELEASE to true)
# tag version in git
@@ -84,16 +87,21 @@ NOTE: Offline builds must use the --url flag to ensure Gitian fetches only from
```
The gbuild invocations below <b>DO NOT DO THIS</b> by default.
-###Build and Sign Bitcoin Core for Linux, Windows, and OS X:
+###Build and sign Bitcoin Core for Linux, Windows, and OS X:
./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml
./bin/gsign --signer $SIGNER --release ${VERSION}-linux --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml
+ mv build/out/bitcoin-*.tar.gz build/out/src/bitcoin-*.tar.gz ../
./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
./bin/gsign --signer $SIGNER --release ${VERSION}-win-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
+ mv build/out/bitcoin-*-win-unsigned.tar.gz inputs/bitcoin-win-unsigned.tar.gz
+ mv build/out/bitcoin-*.zip build/out/bitcoin-*.exe ../
./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml
./bin/gsign --signer $SIGNER --release ${VERSION}-osx-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml
+ mv build/out/bitcoin-*-osx-unsigned.tar.gz inputs/bitcoin-osx-unsigned.tar.gz
+ mv build/out/bitcoin-*.tar.gz build/out/bitcoin-*.dmg ../
Build output expected:
@@ -115,13 +123,6 @@ The gbuild invocations below <b>DO NOT DO THIS</b> by default.
./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-win-unsigned ../bitcoin/contrib/gitian-descriptors/gitian-win.yml
./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-osx-unsigned ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml
-###Move the outputs to the correct directory
-
- mv build/out/bitcoin-*.tar.gz build/out/src/bitcoin-*.tar.gz ../
- mv build/out/bitcoin-*-win-unsigned.tar.gz inputs/bitcoin-win-unsigned.tar.gz
- mv build/out/bitcoin-*.zip build/out/bitcoin-*.exe ../
- mv build/out/bitcoin-*-osx-unsigned.tar.gz inputs/bitcoin-osx-unsigned.tar.gz
- mv build/out/bitcoin-*.tar.gz build/out/bitcoin-*.dmg ../
popd
###Next steps:
@@ -137,7 +138,6 @@ Commit your signature to gitian.sigs:
popd
Wait for Windows/OS X detached signatures:
-
Once the Windows/OS X builds each have 3 matching signatures, they will be signed with their respective release keys.
Detached signatures will then be committed to the [bitcoin-detached-sigs](https://github.com/bitcoin/bitcoin-detached-sigs) repository, which can be combined with the unsigned apps to create signed binaries.
diff --git a/libbitcoinconsensus.pc.in b/libbitcoinconsensus.pc.in
index 3ca1696a31..eb920c47eb 100644
--- a/libbitcoinconsensus.pc.in
+++ b/libbitcoinconsensus.pc.in
@@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-Name: Bitcoin Core consensus library
+Name: @PACKAGE_NAME@ consensus library
Description: Library for the Bitcoin consensus protocol.
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lbitcoinconsensus
diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py
index ca65fb6e79..2135570b8c 100755
--- a/qa/rpc-tests/test_framework/mininode.py
+++ b/qa/rpc-tests/test_framework/mininode.py
@@ -536,7 +536,7 @@ class CBlock(CBlockHeader):
return True
def solve(self):
- self.calc_sha256()
+ self.rehash()
target = uint256_from_compact(self.nBits)
while self.sha256 > target:
self.nNonce += 1
diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in
index a389332a52..6a34d64cd5 100644
--- a/share/qt/Info.plist.in
+++ b/share/qt/Info.plist.in
@@ -17,7 +17,7 @@
<string>APPL</string>
<key>CFBundleGetInfoString</key>
- <string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ The Bitcoin Core developers</string>
+ <string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS_FINAL@</string>
<key>CFBundleShortVersionString</key>
<string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@</string>
diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py
index d4bd585138..2a6e4b930c 100755
--- a/share/qt/extract_strings_qt.py
+++ b/share/qt/extract_strings_qt.py
@@ -70,6 +70,10 @@ f.write("""
#endif
""")
f.write('static const char UNUSED *bitcoin_strings[] = {\n')
+f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),))
+f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),))
+if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'):
+ f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),))
messages.sort(key=operator.itemgetter(0))
for (msgid, msgstr) in messages:
if msgid != EMPTY:
diff --git a/share/setup.nsi.in b/share/setup.nsi.in
index 62db88c271..e553a5ae88 100644
--- a/share/setup.nsi.in
+++ b/share/setup.nsi.in
@@ -6,8 +6,8 @@ SetCompressor /SOLID lzma
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@
-!define COMPANY "Bitcoin Core project"
-!define URL https://bitcoincore.org/
+!define COMPANY "@PACKAGE_NAME@ project"
+!define URL @PACKAGE_URL@
# MUI Symbol Definitions
!define MUI_ICON "@abs_top_srcdir@/share/pixmaps/bitcoin.ico"
@@ -59,7 +59,7 @@ XPStyle on
BrandingText " "
ShowInstDetails show
VIProductVersion ${VERSION}.@CLIENT_VERSION_BUILD@
-VIAddVersionKey ProductName "Bitcoin Core"
+VIAddVersionKey ProductName "@PACKAGE_NAME@"
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
VIAddVersionKey CompanyWebsite "${URL}"
diff --git a/src/Makefile.am b/src/Makefile.am
index b1b8ae123e..c4f7188971 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,6 +4,15 @@ AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS)
AM_CXXFLAGS = $(HARDENED_CXXFLAGS)
AM_CPPFLAGS = $(HARDENED_CPPFLAGS)
+if EMBEDDED_UNIVALUE
+LIBUNIVALUE = univalue/libunivalue.la
+
+$(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*)
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+else
+LIBUNIVALUE = $(UNIVALUE_LIBS)
+endif
+
if EMBEDDED_LEVELDB
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
@@ -23,23 +32,20 @@ BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
-BITCOIN_INCLUDES += -I$(srcdir)/univalue/include
+BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
LIBBITCOIN_SERVER=libbitcoin_server.a
LIBBITCOIN_WALLET=libbitcoin_wallet.a
LIBBITCOIN_COMMON=libbitcoin_common.a
+LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a
LIBBITCOIN_CLI=libbitcoin_cli.a
LIBBITCOIN_UTIL=libbitcoin_util.a
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
LIBBITCOINQT=qt/libbitcoinqt.a
LIBSECP256K1=secp256k1/libsecp256k1.la
-LIBUNIVALUE=univalue/libunivalue.la
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
-$(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*)
- $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
# But to build the less dependent modules first, we manually select their order here:
@@ -47,6 +53,7 @@ EXTRA_LIBRARIES = \
crypto/libbitcoin_crypto.a \
libbitcoin_util.a \
libbitcoin_common.a \
+ libbitcoin_consensus.a \
libbitcoin_server.a \
libbitcoin_cli.a
if ENABLE_WALLET
@@ -59,9 +66,9 @@ endif
if BUILD_BITCOIN_LIBS
lib_LTLIBRARIES = libbitcoinconsensus.la
-LIBBITCOIN_CONSENSUS=libbitcoinconsensus.la
+LIBBITCOINCONSENSUS=libbitcoinconsensus.la
else
-LIBBITCOIN_CONSENSUS=
+LIBBITCOINCONSENSUS=
endif
bin_PROGRAMS =
@@ -81,8 +88,6 @@ endif
BITCOIN_CORE_H = \
addrman.h \
alert.h \
- amount.h \
- arith_uint256.h \
base58.h \
bloom.h \
chain.h \
@@ -100,12 +105,8 @@ BITCOIN_CORE_H = \
compat/sanity.h \
compressor.h \
consensus/consensus.h \
- consensus/merkle.h \
- consensus/params.h \
- consensus/validation.h \
core_io.h \
core_memusage.h \
- hash.h \
httprpc.h \
httpserver.h \
init.h \
@@ -124,24 +125,16 @@ BITCOIN_CORE_H = \
policy/policy.h \
policy/rbf.h \
pow.h \
- prevector.h \
- primitives/block.h \
- primitives/transaction.h \
protocol.h \
- pubkey.h \
random.h \
reverselock.h \
rpc/client.h \
rpc/protocol.h \
rpc/server.h \
scheduler.h \
- script/interpreter.h \
- script/script.h \
- script/script_error.h \
script/sigcache.h \
script/sign.h \
script/standard.h \
- serialize.h \
streams.h \
support/allocators/secure.h \
support/allocators/zeroafterfree.h \
@@ -150,19 +143,15 @@ BITCOIN_CORE_H = \
sync.h \
threadsafety.h \
timedata.h \
- tinyformat.h \
torcontrol.h \
txdb.h \
txmempool.h \
ui_interface.h \
- uint256.h \
undo.h \
util.h \
utilmoneystr.h \
- utilstrencodings.h \
utiltime.h \
validationinterface.h \
- version.h \
wallet/crypter.h \
wallet/db.h \
wallet/rpcwallet.h \
@@ -262,31 +251,57 @@ crypto_libbitcoin_crypto_a_SOURCES = \
crypto/sha512.cpp \
crypto/sha512.h
+# consensus: shared between all executables that validate any consensus rules.
+libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
+libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
+libbitcoin_consensus_a_SOURCES = \
+ amount.h \
+ arith_uint256.cpp \
+ arith_uint256.h \
+ consensus/merkle.cpp \
+ consensus/merkle.h \
+ consensus/params.h \
+ consensus/validation.h \
+ hash.cpp \
+ hash.h \
+ prevector.h \
+ primitives/block.cpp \
+ primitives/block.h \
+ primitives/transaction.cpp \
+ primitives/transaction.h \
+ pubkey.cpp \
+ pubkey.h \
+ script/bitcoinconsensus.cpp \
+ script/interpreter.cpp \
+ script/interpreter.h \
+ script/script.cpp \
+ script/script.h \
+ script/script_error.cpp \
+ script/script_error.h \
+ serialize.h \
+ tinyformat.h \
+ uint256.cpp \
+ uint256.h \
+ utilstrencodings.cpp \
+ utilstrencodings.h \
+ version.h
+
# common: shared between bitcoind, and bitcoin-qt and non-server tools
libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_common_a_SOURCES = \
amount.cpp \
- arith_uint256.cpp \
base58.cpp \
chainparams.cpp \
coins.cpp \
compressor.cpp \
- consensus/merkle.cpp \
core_read.cpp \
core_write.cpp \
- hash.cpp \
key.cpp \
keystore.cpp \
netbase.cpp \
- primitives/block.cpp \
- primitives/transaction.cpp \
protocol.cpp \
- pubkey.cpp \
scheduler.cpp \
- script/interpreter.cpp \
- script/script.cpp \
- script/script_error.cpp \
script/sign.cpp \
script/standard.cpp \
$(BITCOIN_CORE_H)
@@ -307,7 +322,6 @@ libbitcoin_util_a_SOURCES = \
rpc/protocol.cpp \
support/cleanse.cpp \
sync.cpp \
- uint256.cpp \
util.cpp \
utilmoneystr.cpp \
utilstrencodings.cpp \
@@ -343,6 +357,7 @@ bitcoind_LDADD = \
$(LIBBITCOIN_COMMON) \
$(LIBUNIVALUE) \
$(LIBBITCOIN_UTIL) \
+ $(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_CRYPTO) \
$(LIBLEVELDB) \
$(LIBMEMENV) \
@@ -390,6 +405,7 @@ bitcoin_tx_LDADD = \
$(LIBUNIVALUE) \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UTIL) \
+ $(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_CRYPTO) \
$(LIBSECP256K1)
@@ -399,20 +415,7 @@ bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
# bitcoinconsensus library #
if BUILD_BITCOIN_LIBS
include_HEADERS = script/bitcoinconsensus.h
-libbitcoinconsensus_la_SOURCES = \
- crypto/hmac_sha512.cpp \
- crypto/ripemd160.cpp \
- crypto/sha1.cpp \
- crypto/sha256.cpp \
- crypto/sha512.cpp \
- hash.cpp \
- primitives/transaction.cpp \
- pubkey.cpp \
- script/bitcoinconsensus.cpp \
- script/interpreter.cpp \
- script/script.cpp \
- uint256.cpp \
- utilstrencodings.cpp
+libbitcoinconsensus_la_SOURCES = $(crypto_libbitcoin_crypto_a_SOURCES) $(libbitcoin_consensus_a_SOURCES)
if GLIBC_BACK_COMPAT
libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
@@ -453,7 +456,8 @@ clean-local:
.rc.o:
@test -f $(WINDRES)
- $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
+ ## FIXME: How to get the appropriate modulename_CPPFLAGS in here?
+ $(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@
.mm.o:
$(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include
index d660a3a747..8e7b59b461 100644
--- a/src/Makefile.bench.include
+++ b/src/Makefile.bench.include
@@ -14,12 +14,13 @@ bench_bench_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
bench_bench_bitcoin_LDADD = \
$(LIBBITCOIN_SERVER) \
$(LIBBITCOIN_COMMON) \
- $(LIBBITCOIN_UNIVALUE) \
$(LIBBITCOIN_UTIL) \
+ $(LIBBITCOIN_CONSENSUS) \
$(LIBBITCOIN_CRYPTO) \
$(LIBLEVELDB) \
$(LIBMEMENV) \
- $(LIBSECP256K1)
+ $(LIBSECP256K1) \
+ $(LIBUNIVALUE)
if ENABLE_ZMQ
bench_bench_bitcoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 96b7adcbf9..ca4e1e70d0 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -378,7 +378,7 @@ endif
if ENABLE_ZMQ
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif
-qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
+qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
@@ -391,7 +391,7 @@ SECONDARY: $(QT_QM)
qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES)
@test -n $(XGETTEXT) || echo "xgettext is required for updating translations"
- $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) ../share/qt/extract_strings_qt.py $^
+ $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" COPYRIGHT_HOLDERS_SUBSTITUTION="$(COPYRIGHT_HOLDERS_SUBSTITUTION)" ../share/qt/extract_strings_qt.py $^
translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"
diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include
index ede3fac4c3..813a343ffa 100644
--- a/src/Makefile.qttest.include
+++ b/src/Makefile.qttest.include
@@ -33,7 +33,7 @@ endif
if ENABLE_ZMQ
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif
-qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \
+qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \
$(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
$(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index d89132f806..6ef6a69a2c 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -44,7 +44,6 @@ BITCOIN_TESTS =\
test/base64_tests.cpp \
test/bip32_tests.cpp \
test/bloom_tests.cpp \
- test/checkblock_tests.cpp \
test/Checkpoints_tests.cpp \
test/coins_tests.cpp \
test/compress_tests.cpp \
@@ -95,7 +94,7 @@ endif
test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS)
-test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
+test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
$(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1)
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
if ENABLE_WALLET
@@ -129,7 +128,9 @@ check-local:
@echo "Running test/bitcoin-util-test.py..."
$(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
+if EMBEDDED_UNIVALUE
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
+endif
%.json.h: %.json
@$(MKDIR_P) $(@D)
diff --git a/src/bitcoin-cli-res.rc b/src/bitcoin-cli-res.rc
index 1e4aa609bb..58f8f1e8a2 100644
--- a/src/bitcoin-cli-res.rc
+++ b/src/bitcoin-cli-res.rc
@@ -17,7 +17,7 @@ BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
- VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for Bitcoin Core)"
+ VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " PACKAGE_NAME ")"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "bitcoin-cli"
VALUE "LegalCopyright", COPYRIGHT_STR
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index d1d534b05e..34980d9ca1 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -3,6 +3,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "chainparamsbase.h"
#include "clientversion.h"
#include "rpc/client.h"
@@ -69,10 +73,10 @@ static bool AppInitRPC(int argc, char* argv[])
//
ParseParameters(argc, argv);
if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) {
- std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n";
+ std::string strUsage = strprintf(_("%s RPC client version"), _(PACKAGE_NAME)) + " " + FormatFullVersion() + "\n";
if (!mapArgs.count("-version")) {
strUsage += "\n" + _("Usage:") + "\n" +
- " bitcoin-cli [options] <command> [params] " + _("Send command to Bitcoin Core") + "\n" +
+ " bitcoin-cli [options] <command> [params] " + strprintf(_("Send command to %s"), _(PACKAGE_NAME)) + "\n" +
" bitcoin-cli [options] help " + _("List commands") + "\n" +
" bitcoin-cli [options] help <command> " + _("Get help for a command") + "\n";
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
index 2c502ead31..95d7a085a0 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "base58.h"
#include "clientversion.h"
#include "coins.h"
@@ -47,7 +51,7 @@ static bool AppInitRawTx(int argc, char* argv[])
if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help"))
{
// First part of help message is specific to this utility
- std::string strUsage = _("Bitcoin Core bitcoin-tx utility version") + " " + FormatFullVersion() + "\n\n" +
+ std::string strUsage = strprintf(_("%s bitcoin-tx utility version"), _(PACKAGE_NAME)) + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\n" +
" bitcoin-tx [options] <hex-tx> [commands] " + _("Update hex-encoded bitcoin transaction") + "\n" +
" bitcoin-tx [options] -create [commands] " + _("Create hex-encoded bitcoin transaction") + "\n" +
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index d1fd56d177..28bc374acc 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -3,6 +3,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "chainparams.h"
#include "clientversion.h"
#include "rpc/server.h"
@@ -12,6 +16,7 @@
#include "util.h"
#include "httpserver.h"
#include "httprpc.h"
+#include "utilstrencodings.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
@@ -73,16 +78,16 @@ bool AppInit(int argc, char* argv[])
// Process help and version before taking care about datadir
if (mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version"))
{
- std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n";
+ std::string strUsage = strprintf(_("%s Daemon"), _(PACKAGE_NAME)) + " " + _("version") + " " + FormatFullVersion() + "\n";
if (mapArgs.count("-version"))
{
- strUsage += LicenseInfo();
+ strUsage += FormatParagraph(LicenseInfo());
}
else
{
strUsage += "\n" + _("Usage:") + "\n" +
- " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n";
+ " bitcoind [options] " + strprintf(_("Start %s Daemon"), _(PACKAGE_NAME)) + "\n";
strUsage += "\n" + HelpMessage(HMM_BITCOIND);
}
diff --git a/src/clientversion.h b/src/clientversion.h
index 40361660e6..6f255d69c9 100644
--- a/src/clientversion.h
+++ b/src/clientversion.h
@@ -38,7 +38,7 @@
#define DO_STRINGIZE(X) #X
//! Copyright string used in Windows .rc files
-#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers"
+#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " " COPYRIGHT_HOLDERS_FINAL
/**
* bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 432a5c0792..a447a3eff8 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -21,6 +21,9 @@
#include <boost/algorithm/string.hpp> // boost::trim
#include <boost/foreach.hpp> //BOOST_FOREACH
+/** WWW-Authenticate to present with 401 Unauthorized response */
+static const char* WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\"";
+
/** Simple one-shot callback timer to be used by the RPC mechanism to e.g.
* re-lock the wellet.
*/
@@ -151,6 +154,7 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
// Check authorization
std::pair<bool, std::string> authHeader = req->GetHeader("authorization");
if (!authHeader.first) {
+ req->WriteHeader("WWW-Authenticate", WWW_AUTH_HEADER_DATA);
req->WriteReply(HTTP_UNAUTHORIZED);
return false;
}
@@ -163,6 +167,7 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
shouldn't have their RPC port exposed. */
MilliSleep(250);
+ req->WriteHeader("WWW-Authenticate", WWW_AUTH_HEADER_DATA);
req->WriteReply(HTTP_UNAUTHORIZED);
return false;
}
diff --git a/src/init.cpp b/src/init.cpp
index b4ae380404..9ca417b83a 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -33,7 +33,6 @@
#include "ui_interface.h"
#include "util.h"
#include "utilmoneystr.h"
-#include "utilstrencodings.h"
#include "validationinterface.h"
#ifdef ENABLE_WALLET
#include "wallet/db.h"
@@ -47,8 +46,10 @@
#include <signal.h>
#endif
+#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
+#include <boost/algorithm/string/split.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/function.hpp>
@@ -367,7 +368,6 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-onion=<ip:port>", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy"));
strUsage += HelpMessageOpt("-onlynet=<net>", _("Only connect to nodes in network <net> (ipv4, ipv6 or onion)"));
strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), DEFAULT_PERMIT_BAREMULTISIG));
- strUsage += HelpMessageOpt("-permitrbf", strprintf(_("Permit transaction replacements in the memory pool (default: %u)"), DEFAULT_PERMIT_REPLACEMENT));
strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with bloom filters (default: %u)"), 1));
if (showDebug)
strUsage += HelpMessageOpt("-enforcenodebloom", strprintf("Enforce minimum protocol version to limit use of bloom filters (default: %u)", 0));
@@ -489,6 +489,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-bytespersigop", strprintf(_("Minimum bytes per sigop in transactions we relay and mine (default: %u)"), DEFAULT_BYTES_PER_SIGOP));
strUsage += HelpMessageOpt("-datacarrier", strprintf(_("Relay and mine data carrier transactions (default: %u)"), DEFAULT_ACCEPT_DATACARRIER));
strUsage += HelpMessageOpt("-datacarriersize", strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"), MAX_OP_RETURN_RELAY));
+ strUsage += HelpMessageOpt("-mempoolreplacement", strprintf(_("Enable transaction replacement in the memory pool (default: %u)"), DEFAULT_ENABLE_REPLACEMENT));
strUsage += HelpMessageGroup(_("Block creation options:"));
strUsage += HelpMessageOpt("-blockminsize=<n>", strprintf(_("Set minimum block size in bytes (default: %u)"), DEFAULT_BLOCK_MIN_SIZE));
@@ -519,13 +520,13 @@ std::string HelpMessage(HelpMessageMode mode)
std::string LicenseInfo()
{
// todo: remove urls from translations on next change
- return FormatParagraph(strprintf(_("Copyright (C) 2009-%i The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n" +
+ return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) + " ") + "\n" +
"\n" +
- FormatParagraph(_("This is experimental software.")) + "\n" +
+ _("This is experimental software.") + "\n" +
"\n" +
- FormatParagraph(_("Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.")) + "\n" +
+ _("Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.") + "\n" +
"\n" +
- FormatParagraph(_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.")) +
+ _("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.") +
"\n";
}
@@ -1040,7 +1041,15 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
nLocalServices |= NODE_BLOOM;
nMaxTipAge = GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE);
- fPermitReplacement = GetBoolArg("-permitrbf", DEFAULT_PERMIT_REPLACEMENT);
+
+ fEnableReplacement = GetBoolArg("-mempoolreplacement", DEFAULT_ENABLE_REPLACEMENT);
+ if ((!fEnableReplacement) && mapArgs.count("-mempoolreplacement")) {
+ // Minimal effort at forwards compatibility
+ std::string strReplacementModeList = GetArg("-mempoolreplacement", ""); // default is impossible
+ std::vector<std::string> vstrReplacementModes;
+ boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(","));
+ fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "fee") != vstrReplacementModes.end());
+ }
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
@@ -1050,7 +1059,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
// Sanity check
if (!InitSanityCheck())
- return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down."));
+ return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), _(PACKAGE_NAME)));
std::string strDataDir = GetDataDir().string();
#ifdef ENABLE_WALLET
@@ -1066,9 +1075,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
try {
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
if (!lock.try_lock())
- return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running."), strDataDir));
+ return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), strDataDir, _(PACKAGE_NAME)));
} catch(const boost::interprocess::interprocess_exception& e) {
- return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running.") + " %s.", strDataDir, e.what()));
+ return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running.") + " %s.", strDataDir, _(PACKAGE_NAME), e.what()));
}
#ifndef WIN32
@@ -1481,10 +1490,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
" or address book entries might be missing or incorrect."));
}
else if (nLoadWalletRet == DB_TOO_NEW)
- strErrors << _("Error loading wallet.dat: Wallet requires newer version of Bitcoin Core") << "\n";
+ strErrors << strprintf(_("Error loading wallet.dat: Wallet requires newer version of %s"), _(PACKAGE_NAME)) << "\n";
else if (nLoadWalletRet == DB_NEED_REWRITE)
{
- strErrors << _("Wallet needed to be rewritten: restart Bitcoin Core to complete") << "\n";
+ strErrors << strprintf(_("Wallet needed to be rewritten: restart %s to complete"), _(PACKAGE_NAME)) << "\n";
LogPrintf("%s", strErrors.str());
return InitError(strErrors.str());
}
diff --git a/src/main.cpp b/src/main.cpp
index 4d16b9f9ac..3ad2979b6b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -76,7 +76,7 @@ size_t nCoinCacheUsage = 5000 * 300;
uint64_t nPruneTarget = 0;
bool fAlerts = DEFAULT_ALERTS;
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
-bool fPermitReplacement = DEFAULT_PERMIT_REPLACEMENT;
+bool fEnableReplacement = DEFAULT_ENABLE_REPLACEMENT;
CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);
CAmount maxTxFee = DEFAULT_TRANSACTION_MAXFEE;
@@ -332,8 +332,10 @@ void FinalizeNode(NodeId nodeid) {
AddressCurrentlyConnected(state->address);
}
- BOOST_FOREACH(const QueuedBlock& entry, state->vBlocksInFlight)
+ BOOST_FOREACH(const QueuedBlock& entry, state->vBlocksInFlight) {
+ nQueuedValidatedHeaders -= entry.fValidatedHeaders;
mapBlocksInFlight.erase(entry.hash);
+ }
EraseOrphansFor(nodeid);
nPreferredDownload -= state->fPreferredDownload;
@@ -812,8 +814,8 @@ std::string FormatStateMessage(const CValidationState &state)
state.GetRejectCode());
}
-bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
- bool* pfMissingInputs, bool fOverrideMempoolLimit, bool fRejectAbsurdFee,
+bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const CTransaction& tx, bool fLimitFree,
+ bool* pfMissingInputs, bool fOverrideMempoolLimit, const CAmount nAbsurdFee,
std::vector<uint256>& vHashTxnToUncache)
{
const uint256 hash = tx.GetHash();
@@ -867,7 +869,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C
// unconfirmed ancestors anyway; doing otherwise is hopelessly
// insecure.
bool fReplacementOptOut = true;
- if (fPermitReplacement)
+ if (fEnableReplacement)
{
BOOST_FOREACH(const CTxIn &txin, ptxConflicting->vin)
{
@@ -1002,10 +1004,10 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C
dFreeCount += nSize;
}
- if (fRejectAbsurdFee && nFees > maxTxFee)
+ if (nAbsurdFee && nFees > nAbsurdFee)
return state.Invalid(false,
REJECT_HIGHFEE, "absurdly-high-fee",
- strprintf("%d > %d", nFees, maxTxFee));
+ strprintf("%d > %d", nFees, nAbsurdFee));
// Calculate in-mempool ancestors, up to a limit.
CTxMemPool::setEntries setAncestors;
@@ -1214,16 +1216,16 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C
}
}
- SyncWithWallets(tx, NULL);
+ SyncWithWallets(tx, NULL, NULL);
return true;
}
bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
- bool* pfMissingInputs, bool fOverrideMempoolLimit, bool fRejectAbsurdFee)
+ bool* pfMissingInputs, bool fOverrideMempoolLimit, const CAmount nAbsurdFee)
{
std::vector<uint256> vHashTxToUncache;
- bool res = AcceptToMemoryPoolWorker(pool, state, tx, fLimitFree, pfMissingInputs, fOverrideMempoolLimit, fRejectAbsurdFee, vHashTxToUncache);
+ bool res = AcceptToMemoryPoolWorker(pool, state, tx, fLimitFree, pfMissingInputs, fOverrideMempoolLimit, nAbsurdFee, vHashTxToUncache);
if (!res) {
BOOST_FOREACH(const uint256& hashTx, vHashTxToUncache)
pcoinsTip->Uncache(hashTx);
@@ -2260,7 +2262,7 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
return AbortNode(state, "Failed to write to coin database");
nLastFlush = nNow;
}
- if ((mode == FLUSH_STATE_ALWAYS || mode == FLUSH_STATE_PERIODIC) && nNow > nLastSetChain + (int64_t)DATABASE_WRITE_INTERVAL * 1000000) {
+ if (fDoFullFlush || ((mode == FLUSH_STATE_ALWAYS || mode == FLUSH_STATE_PERIODIC) && nNow > nLastSetChain + (int64_t)DATABASE_WRITE_INTERVAL * 1000000)) {
// Update best block in wallet (so we can detect restored wallets).
GetMainSignals().SetBestChain(chainActive.GetLocator());
nLastSetChain = nNow;
@@ -2291,8 +2293,9 @@ void static UpdateTip(CBlockIndex *pindexNew) {
nTimeBestReceived = GetTime();
mempool.AddTransactionsUpdated(1);
- LogPrintf("%s: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%.1fMiB(%utx)\n", __func__,
- chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), log(chainActive.Tip()->nChainWork.getdouble())/log(2.0), (unsigned long)chainActive.Tip()->nChainTx,
+ LogPrintf("%s: new best=%s height=%d bits=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%.1fMiB(%utx)\n", __func__,
+ chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), chainActive.Tip()->nBits,
+ log(chainActive.Tip()->nChainWork.getdouble())/log(2.0), (unsigned long)chainActive.Tip()->nChainTx,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()),
Checkpoints::GuessVerificationProgress(chainParams.Checkpoints(), chainActive.Tip()), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());
@@ -2366,7 +2369,7 @@ bool static DisconnectTip(CValidationState& state, const Consensus::Params& cons
// Let wallets know transactions went from 1-confirmed to
// 0-confirmed or conflicted:
BOOST_FOREACH(const CTransaction &tx, block.vtx) {
- SyncWithWallets(tx, NULL);
+ SyncWithWallets(tx, pindexDelete->pprev, NULL);
}
return true;
}
@@ -2425,11 +2428,11 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
// Tell wallet about transactions that went from mempool
// to conflicted:
BOOST_FOREACH(const CTransaction &tx, txConflicted) {
- SyncWithWallets(tx, NULL);
+ SyncWithWallets(tx, pindexNew, NULL);
}
// ... and about transactions that got confirmed:
BOOST_FOREACH(const CTransaction &tx, pblock->vtx) {
- SyncWithWallets(tx, pblock);
+ SyncWithWallets(tx, pindexNew, pblock);
}
int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1;
@@ -3169,16 +3172,10 @@ static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned
bool ProcessNewBlock(CValidationState& state, const CChainParams& chainparams, const CNode* pfrom, const CBlock* pblock, bool fForceProcessing, CDiskBlockPos* dbp)
{
- // Preliminary checks
- bool checked = CheckBlock(*pblock, state);
-
{
LOCK(cs_main);
bool fRequested = MarkBlockAsReceived(pblock->GetHash());
fRequested |= fForceProcessing;
- if (!checked) {
- return error("%s: CheckBlock FAILED %s", __func__, FormatStateMessage(state));
- }
// Store to disk
CBlockIndex *pindex = NULL;
diff --git a/src/main.h b/src/main.h
index 793737422e..4061daba3b 100644
--- a/src/main.h
+++ b/src/main.h
@@ -115,8 +115,8 @@ static const bool DEFAULT_TXINDEX = false;
static const unsigned int DEFAULT_BANSCORE_THRESHOLD = 100;
static const bool DEFAULT_TESTSAFEMODE = false;
-/** Default for -permitrbf */
-static const bool DEFAULT_PERMIT_REPLACEMENT = true;
+/** Default for -mempoolreplacement */
+static const bool DEFAULT_ENABLE_REPLACEMENT = true;
/** Maximum number of headers to announce when relaying blocks with headers message.*/
static const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8;
@@ -153,7 +153,7 @@ extern CAmount maxTxFee;
extern bool fAlerts;
/** If the tip is older than this (in seconds), the node is considered to be in initial block download. */
extern int64_t nMaxTipAge;
-extern bool fPermitReplacement;
+extern bool fEnableReplacement;
/** Best header we've seen so far (used for getheaders queries' starting points). */
extern CBlockIndex *pindexBestHeader;
@@ -281,7 +281,7 @@ void PruneAndFlush();
/** (try to) add transaction to memory pool **/
bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
- bool* pfMissingInputs, bool fOverrideMempoolLimit=false, bool fRejectAbsurdFee=false);
+ bool* pfMissingInputs, bool fOverrideMempoolLimit=false, const CAmount nAbsurdFee=0);
/** Convert CValidationState to a human-readable message for logging */
std::string FormatStateMessage(const CValidationState &state);
@@ -407,23 +407,27 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex, const Consensus
/** Functions for validating blocks and updating the block tree */
-/** Undo the effects of this block (with given index) on the UTXO set represented by coins.
- * In case pfClean is provided, operation will try to be tolerant about errors, and *pfClean
- * will be true if no problems were found. Otherwise, the return value will be false in case
- * of problems. Note that in any case, coins may be modified. */
-bool DisconnectBlock(const CBlock& block, CValidationState& state, const CBlockIndex* pindex, CCoinsViewCache& coins, bool* pfClean = NULL);
-
-/** Apply the effects of this block (with given index) on the UTXO set represented by coins */
-bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool fJustCheck = false);
-
/** Context-independent validity checks */
bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW = true);
bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = true, bool fCheckMerkleRoot = true);
-/** Context-dependent validity checks */
+/** Context-dependent validity checks.
+ * By "context", we mean only the previous block headers, but not the UTXO
+ * set; UTXO-related validity checks are done in ConnectBlock(). */
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex *pindexPrev);
bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex *pindexPrev);
+/** Apply the effects of this block (with given index) on the UTXO set represented by coins.
+ * Validity checks that depend on the UTXO set are also done; ConnectBlock()
+ * can fail if those validity checks fail (among other reasons). */
+bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool fJustCheck = false);
+
+/** Undo the effects of this block (with given index) on the UTXO set represented by coins.
+ * In case pfClean is provided, operation will try to be tolerant about errors, and *pfClean
+ * will be true if no problems were found. Otherwise, the return value will be false in case
+ * of problems. Note that in any case, coins may be modified. */
+bool DisconnectBlock(const CBlock& block, CValidationState& state, const CBlockIndex* pindex, CCoinsViewCache& coins, bool* pfClean = NULL);
+
/** Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held) */
bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true);
diff --git a/src/net.cpp b/src/net.cpp
index 14e22f6cb3..d9c4c11737 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1857,7 +1857,7 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste
{
int nErr = WSAGetLastError();
if (nErr == WSAEADDRINUSE)
- strError = strprintf(_("Unable to bind to %s on this computer. Bitcoin Core is probably already running."), addrBind.ToString());
+ strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToString(), _(PACKAGE_NAME));
else
strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToString(), NetworkErrorString(nErr));
LogPrintf("%s\n", strError);
@@ -1943,8 +1943,10 @@ void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler)
CAddrDB adb;
if (adb.Read(addrman))
LogPrintf("Loaded %i addresses from peers.dat %dms\n", addrman.size(), GetTimeMillis() - nStart);
- else
+ else {
LogPrintf("Invalid or missing peers.dat; recreating\n");
+ DumpAddresses();
+ }
}
uiInterface.InitMessage(_("Loading banlist..."));
@@ -1959,8 +1961,11 @@ void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrint("net", "Loaded %d banned node ips/subnets from banlist.dat %dms\n",
banmap.size(), GetTimeMillis() - nStart);
- } else
+ } else {
LogPrintf("Invalid or missing banlist.dat; recreating\n");
+ CNode::SetBannedSetDirty(true); // force write
+ DumpBanlist();
+ }
fAddressesInitialized = true;
diff --git a/src/net.h b/src/net.h
index 5f249c445a..833c9cf07c 100644
--- a/src/net.h
+++ b/src/net.h
@@ -302,7 +302,7 @@ public:
{
switch (banReason) {
case BanReasonNodeMisbehaving:
- return "node misbehabing";
+ return "node misbehaving";
case BanReasonManuallyAdded:
return "manually added";
default:
diff --git a/src/pow.cpp b/src/pow.cpp
index 40c72f9d79..058404f357 100644
--- a/src/pow.cpp
+++ b/src/pow.cpp
@@ -9,7 +9,6 @@
#include "chain.h"
#include "primitives/block.h"
#include "uint256.h"
-#include "util.h"
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
{
@@ -57,7 +56,6 @@ unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nF
// Limit adjustment step
int64_t nActualTimespan = pindexLast->GetBlockTime() - nFirstBlockTime;
- LogPrintf(" nActualTimespan = %d before bounds\n", nActualTimespan);
if (nActualTimespan < params.nPowTargetTimespan/4)
nActualTimespan = params.nPowTargetTimespan/4;
if (nActualTimespan > params.nPowTargetTimespan*4)
@@ -75,12 +73,6 @@ unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nF
if (bnNew > bnPowLimit)
bnNew = bnPowLimit;
- /// debug print
- LogPrintf("GetNextWorkRequired RETARGET\n");
- LogPrintf("params.nPowTargetTimespan = %d nActualTimespan = %d\n", params.nPowTargetTimespan, nActualTimespan);
- LogPrintf("Before: %08x %s\n", pindexLast->nBits, bnOld.ToString());
- LogPrintf("After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString());
-
return bnNew.GetCompact();
}
@@ -94,11 +86,11 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&
// Check range
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
- return error("CheckProofOfWork(): nBits below minimum work");
+ return false;
// Check proof of work matches claimed amount
if (UintToArith256(hash) > bnTarget)
- return error("CheckProofOfWork(): hash doesn't match nBits");
+ return false;
return true;
}
diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp
index 680751bb6a..415bffb991 100644
--- a/src/qt/askpassphrasedialog.cpp
+++ b/src/qt/askpassphrasedialog.cpp
@@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "askpassphrasedialog.h"
#include "ui_askpassphrasedialog.h"
@@ -119,9 +123,9 @@ void AskPassphraseDialog::accept()
{
QMessageBox::warning(this, tr("Wallet encrypted"),
"<qt>" +
- tr("Bitcoin Core will close now to finish the encryption process. "
+ tr("%1 will close now to finish the encryption process. "
"Remember that encrypting your wallet cannot fully protect "
- "your bitcoins from being stolen by malware infecting your computer.") +
+ "your bitcoins from being stolen by malware infecting your computer.").arg(tr(PACKAGE_NAME)) +
"<br><br><b>" +
tr("IMPORTANT: Any previous backups you have made of your wallet file "
"should be replaced with the newly generated, encrypted wallet file. "
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index b33df45fb9..9c21bb24ce 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -580,14 +580,14 @@ int main(int argc, char *argv[])
/// - Do not call GetDataDir(true) before this step finishes
if (!boost::filesystem::is_directory(GetDataDir(false)))
{
- QMessageBox::critical(0, QObject::tr("Bitcoin Core"),
+ QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
return 1;
}
try {
ReadConfigFile(mapArgs, mapMultiArgs);
} catch (const std::exception& e) {
- QMessageBox::critical(0, QObject::tr("Bitcoin Core"),
+ QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),
QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what()));
return false;
}
@@ -602,7 +602,7 @@ int main(int argc, char *argv[])
try {
SelectParams(ChainNameFromCommandLine());
} catch(std::exception &e) {
- QMessageBox::critical(0, QObject::tr("Bitcoin Core"), QObject::tr("Error: %1").arg(e.what()));
+ QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: %1").arg(e.what()));
return 1;
}
#ifdef ENABLE_WALLET
@@ -662,7 +662,7 @@ int main(int argc, char *argv[])
app.createWindow(networkStyle.data());
app.requestInitialize();
#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000
- WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Bitcoin Core didn't yet exit safely..."), (HWND)app.getMainWinId());
+ WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId());
#endif
app.exec();
app.requestShutdown();
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 701c96d06f..b00cdfcaf2 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "bitcoingui.h"
#include "bitcoinunits.h"
@@ -115,7 +119,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
{
GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this);
- QString windowTitle = tr("Bitcoin Core") + " - ";
+ QString windowTitle = tr(PACKAGE_NAME) + " - ";
#ifdef ENABLE_WALLET
/* if compiled with wallet support, -disablewallet can still disable the wallet */
enableWallet = !GetBoolArg("-disablewallet", false);
@@ -313,14 +317,14 @@ void BitcoinGUI::createActions()
quitAction->setStatusTip(tr("Quit application"));
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
quitAction->setMenuRole(QAction::QuitRole);
- aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About Bitcoin Core"), this);
- aboutAction->setStatusTip(tr("Show information about Bitcoin Core"));
+ aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(tr(PACKAGE_NAME)), this);
+ aboutAction->setStatusTip(tr("Show information about %1").arg(tr(PACKAGE_NAME)));
aboutAction->setMenuRole(QAction::AboutRole);
aboutQtAction = new QAction(platformStyle->TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this);
aboutQtAction->setStatusTip(tr("Show information about Qt"));
aboutQtAction->setMenuRole(QAction::AboutQtRole);
optionsAction = new QAction(platformStyle->TextColorIcon(":/icons/options"), tr("&Options..."), this);
- optionsAction->setStatusTip(tr("Modify configuration options for Bitcoin Core"));
+ optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(tr(PACKAGE_NAME)));
optionsAction->setMenuRole(QAction::PreferencesRole);
toggleHideAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&Show / Hide"), this);
toggleHideAction->setStatusTip(tr("Show or hide the main Window"));
@@ -350,7 +354,7 @@ void BitcoinGUI::createActions()
showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), tr("&Command-line options"), this);
showHelpMessageAction->setMenuRole(QAction::NoRole);
- showHelpMessageAction->setStatusTip(tr("Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options"));
+ showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(tr(PACKAGE_NAME)));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
@@ -528,7 +532,7 @@ void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle)
{
#ifndef Q_OS_MAC
trayIcon = new QSystemTrayIcon(this);
- QString toolTip = tr("Bitcoin Core client") + " " + networkStyle->getTitleAddText();
+ QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText();
trayIcon->setToolTip(toolTip);
trayIcon->setIcon(networkStyle->getTrayAndWindowIcon());
trayIcon->show();
diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui
index a292924c82..febbaeda1b 100644
--- a/src/qt/forms/debugwindow.ui
+++ b/src/qt/forms/debugwindow.ui
@@ -415,7 +415,7 @@
<item>
<widget class="QPushButton" name="openDebugLogfileButton">
<property name="toolTip">
- <string>Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files.</string>
+ <string>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</string>
</property>
<property name="text">
<string>&amp;Open</string>
diff --git a/src/qt/forms/helpmessagedialog.ui b/src/qt/forms/helpmessagedialog.ui
index dc7df9d6c8..b7f941f70b 100644
--- a/src/qt/forms/helpmessagedialog.ui
+++ b/src/qt/forms/helpmessagedialog.ui
@@ -10,9 +10,6 @@
<height>400</height>
</rect>
</property>
- <property name="windowTitle">
- <string notr="true">Bitcoin Core - Command-line options</string>
- </property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
diff --git a/src/qt/forms/intro.ui b/src/qt/forms/intro.ui
index 09e7bdb024..e4ff3da1ab 100644
--- a/src/qt/forms/intro.ui
+++ b/src/qt/forms/intro.ui
@@ -15,12 +15,12 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QLabel" name="label_2">
+ <widget class="QLabel" name="welcomeLabel">
<property name="styleSheet">
<string notr="true">QLabel { font-style:italic; }</string>
</property>
<property name="text">
- <string>Welcome to Bitcoin Core.</string>
+ <string>Welcome to %1.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -44,9 +44,9 @@
</spacer>
</item>
<item>
- <widget class="QLabel" name="label_4">
+ <widget class="QLabel" name="storageLabel">
<property name="text">
- <string>As this is the first time the program is launched, you can choose where Bitcoin Core will store its data.</string>
+ <string>As this is the first time the program is launched, you can choose where %1 will store its data.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -56,7 +56,7 @@
<item>
<widget class="QLabel" name="sizeWarningLabel">
<property name="text">
- <string>Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</string>
+ <string>%1 will download and store a copy of the Bitcoin block chain. At least %2GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui
index 22c67b8040..c712e6ea01 100644
--- a/src/qt/forms/optionsdialog.ui
+++ b/src/qt/forms/optionsdialog.ui
@@ -30,10 +30,10 @@
<item>
<widget class="QCheckBox" name="bitcoinAtStartup">
<property name="toolTip">
- <string>Automatically start Bitcoin Core after logging in to the system.</string>
+ <string>Automatically start %1 after logging in to the system.</string>
</property>
<property name="text">
- <string>&amp;Start Bitcoin Core on system login</string>
+ <string>&amp;Start %1 on system login</string>
</property>
</widget>
</item>
@@ -562,7 +562,7 @@
<item>
<widget class="QValueComboBox" name="lang">
<property name="toolTip">
- <string>The user interface language can be set here. This setting will take effect after restarting Bitcoin Core.</string>
+ <string>The user interface language can be set here. This setting will take effect after restarting %1.</string>
</property>
</widget>
</item>
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index f324c6dc5a..6d6af54290 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "intro.h"
#include "ui_intro.h"
@@ -118,11 +122,13 @@ Intro::Intro(QWidget *parent) :
signalled(false)
{
ui->setupUi(this);
+ ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME)));
+ ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME)));
uint64_t pruneTarget = std::max<int64_t>(0, GetArg("-prune", 0));
requiredSpace = BLOCK_CHAIN_SIZE;
if (pruneTarget)
requiredSpace = CHAIN_STATE_SIZE + std::ceil(pruneTarget * 1024 * 1024.0 / GB_BYTES);
- ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(requiredSpace));
+ ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(tr(PACKAGE_NAME)).arg(requiredSpace));
startThread();
}
@@ -191,7 +197,7 @@ void Intro::pickDataDirectory()
TryCreateDirectory(GUIUtil::qstringToBoostPath(dataDir));
break;
} catch (const fs::filesystem_error&) {
- QMessageBox::critical(0, tr("Bitcoin Core"),
+ QMessageBox::critical(0, tr(PACKAGE_NAME),
tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir));
/* fall through, back to choosing screen */
}
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index ae1c05240e..95a3fa8d21 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -78,6 +78,11 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
/* Display elements init */
QDir translations(":translations");
+
+ ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(tr(PACKAGE_NAME)));
+ ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(tr(PACKAGE_NAME)));
+
+ ui->lang->setToolTip(ui->lang->toolTip().arg(tr(PACKAGE_NAME)));
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
Q_FOREACH(const QString &langStr, translations.entryList())
{
diff --git a/src/qt/res/bitcoin-qt-res.rc b/src/qt/res/bitcoin-qt-res.rc
index 9f66d0af79..19c3d5d97d 100644
--- a/src/qt/res/bitcoin-qt-res.rc
+++ b/src/qt/res/bitcoin-qt-res.rc
@@ -19,13 +19,13 @@ BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
- VALUE "FileDescription", "Bitcoin Core (GUI node for Bitcoin)"
+ VALUE "FileDescription", PACKAGE_NAME " (GUI node for Bitcoin)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "bitcoin-qt"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "bitcoin-qt.exe"
- VALUE "ProductName", "Bitcoin Core"
+ VALUE "ProductName", PACKAGE_NAME
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 9162642ea8..c18c405256 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "rpcconsole.h"
#include "ui_debugwindow.h"
@@ -252,6 +256,8 @@ RPCConsole::RPCConsole(const PlatformStyle *platformStyle, QWidget *parent) :
ui->setupUi(this);
GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this);
+ ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME)));
+
if (platformStyle->getImagesOnButtons()) {
ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export"));
}
@@ -527,7 +533,7 @@ void RPCConsole::clear()
).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize))
);
- message(CMD_REPLY, (tr("Welcome to the Bitcoin Core RPC console.") + "<br>" +
+ message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(tr(PACKAGE_NAME)) + "<br>" +
tr("Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.") + "<br>" +
tr("Type <b>help</b> for an overview of available commands.")), true);
}
diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp
index 9195b3b724..b46321fa86 100644
--- a/src/qt/splashscreen.cpp
+++ b/src/qt/splashscreen.cpp
@@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "splashscreen.h"
#include "networkstyle.h"
@@ -38,9 +42,9 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
#endif
// define text to place
- QString titleText = tr("Bitcoin Core");
+ QString titleText = tr(PACKAGE_NAME);
QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion()));
- QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers"));
+ QString copyrightText = QString::fromUtf8(CopyrightHolders(strprintf("\xc2\xA9 %u-%u ", 2009, COPYRIGHT_YEAR)).c_str());
QString titleAddText = networkStyle->getTitleAddText();
QString font = QApplication::font().toString();
@@ -75,10 +79,9 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
// check font size and drawing with
pixPaint.setFont(QFont(font, 33*fontFactor));
QFontMetrics fm = pixPaint.fontMetrics();
- int titleTextWidth = fm.width(titleText);
- if(titleTextWidth > 160) {
- // strange font rendering, Arial probably not found
- fontFactor = 0.75;
+ int titleTextWidth = fm.width(titleText);
+ if (titleTextWidth > 176) {
+ fontFactor = fontFactor * 176 / titleTextWidth;
}
pixPaint.setFont(QFont(font, 33*fontFactor));
@@ -98,8 +101,13 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle)
pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText);
// draw copyright stuff
- pixPaint.setFont(QFont(font, 10*fontFactor));
- pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText);
+ {
+ pixPaint.setFont(QFont(font, 10*fontFactor));
+ const int x = pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight;
+ const int y = paddingTop+titleCopyrightVSpace;
+ QRect copyrightRect(x, y, pixmap.width() - x - paddingRight, pixmap.height() - y);
+ pixPaint.drawText(copyrightRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, copyrightText);
+ }
// draw additional text if special network
if(!titleAddText.isEmpty()) {
diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp
index 75ab9c4c3a..947bcdb15a 100644
--- a/src/qt/utilitydialog.cpp
+++ b/src/qt/utilitydialog.cpp
@@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "utilitydialog.h"
#include "ui_helpmessagedialog.h"
@@ -33,7 +37,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
{
ui->setupUi(this);
- QString version = tr("Bitcoin Core") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion());
+ QString version = tr(PACKAGE_NAME) + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion());
/* On x86 add a bit specifier to the version so that users can distinguish between
* 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambigious.
*/
@@ -45,7 +49,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
if (about)
{
- setWindowTitle(tr("About Bitcoin Core"));
+ setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME)));
/// HTML-format the license message from the core
QString licenseInfo = QString::fromStdString(LicenseInfo());
@@ -55,7 +59,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
uri.setMinimal(true); // use non-greedy matching
licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
// Replace newlines with HTML breaks
- licenseInfoHTML.replace("\n\n", "<br><br>");
+ licenseInfoHTML.replace("\n", "<br>");
ui->aboutMessage->setTextFormat(Qt::RichText);
ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
@@ -162,7 +166,7 @@ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f):
{
QVBoxLayout *layout = new QVBoxLayout();
layout->addWidget(new QLabel(
- tr("Bitcoin Core is shutting down...") + "<br /><br />" +
+ tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "<br /><br />" +
tr("Do not shut down the computer until this window disappears.")));
setLayout(layout);
}
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 996b7f9cbd..fec0987a4c 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -68,7 +68,7 @@ UniValue GetNetworkHashPS(int lookup, int height) {
arith_uint256 workDiff = pb->nChainWork - pb0->nChainWork;
int64_t timeDiff = maxTime - minTime;
- return (int64_t)(workDiff.getdouble() / timeDiff);
+ return workDiff.getdouble() / timeDiff;
}
UniValue getnetworkhashps(const UniValue& params, bool fHelp)
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 2ec80f468c..de89fdeb0f 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -810,9 +810,9 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
uint256 hashTx = tx.GetHash();
- bool fOverrideFees = false;
- if (params.size() > 1)
- fOverrideFees = params[1].get_bool();
+ CAmount nMaxRawTxFee = maxTxFee;
+ if (params.size() > 1 && params[1].get_bool())
+ nMaxRawTxFee = 0;
CCoinsViewCache &view = *pcoinsTip;
const CCoins* existingCoins = view.AccessCoins(hashTx);
@@ -822,7 +822,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
// push to local node and sync with wallets
CValidationState state;
bool fMissingInputs;
- if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, false, !fOverrideFees)) {
+ if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, false, nMaxRawTxFee)) {
if (state.IsInvalid()) {
throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
} else {
diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp
deleted file mode 100644
index c945a95adc..0000000000
--- a/src/test/checkblock_tests.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2013-2015 The Bitcoin Core developers
-// Distributed under the MIT software license, see the accompanying
-// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-#include "clientversion.h"
-#include "consensus/validation.h"
-#include "main.h" // For CheckBlock
-#include "primitives/block.h"
-#include "test/test_bitcoin.h"
-#include "utiltime.h"
-
-#include <cstdio>
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-#include <boost/test/unit_test.hpp>
-
-
-BOOST_FIXTURE_TEST_SUITE(CheckBlock_tests, BasicTestingSetup)
-
-bool read_block(const std::string& filename, CBlock& block)
-{
- namespace fs = boost::filesystem;
- fs::path testFile = fs::current_path() / "data" / filename;
-#ifdef TEST_DATA_DIR
- if (!fs::exists(testFile))
- {
- testFile = fs::path(BOOST_PP_STRINGIZE(TEST_DATA_DIR)) / filename;
- }
-#endif
- FILE* fp = fopen(testFile.string().c_str(), "rb");
- if (!fp) return false;
-
- fseek(fp, 8, SEEK_SET); // skip msgheader/size
-
- CAutoFile filein(fp, SER_DISK, CLIENT_VERSION);
- if (filein.IsNull()) return false;
-
- filein >> block;
-
- return true;
-}
-
-BOOST_AUTO_TEST_CASE(May15)
-{
- // Putting a 1MB binary file in the git repository is not a great
- // idea, so this test is only run if you manually download
- // test/data/Mar12Fork.dat from
- // http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/Mar12Fork.dat/download
- unsigned int tMay15 = 1368576000;
- SetMockTime(tMay15); // Test as if it was right at May 15
-
- CBlock forkingBlock;
- if (read_block("Mar12Fork.dat", forkingBlock))
- {
- CValidationState state;
-
- // After May 15'th, big blocks are OK:
- forkingBlock.nTime = tMay15; // Invalidates PoW
- BOOST_CHECK(CheckBlock(forkingBlock, state, false, false));
- }
-
- SetMockTime(0);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp
index 66be9d3d5e..c29e30792a 100644
--- a/src/test/txvalidationcache_tests.cpp
+++ b/src/test/txvalidationcache_tests.cpp
@@ -23,7 +23,7 @@ ToMemPool(CMutableTransaction& tx)
LOCK(cs_main);
CValidationState state;
- return AcceptToMemoryPool(mempool, state, tx, false, NULL, true, false);
+ return AcceptToMemoryPool(mempool, state, tx, false, NULL, true, 0);
}
BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp
index 28cecfffaf..01bc2032d0 100644
--- a/src/test/util_tests.cpp
+++ b/src/test/util_tests.cpp
@@ -399,12 +399,27 @@ BOOST_AUTO_TEST_CASE(test_FormatParagraph)
{
BOOST_CHECK_EQUAL(FormatParagraph("", 79, 0), "");
BOOST_CHECK_EQUAL(FormatParagraph("test", 79, 0), "test");
- BOOST_CHECK_EQUAL(FormatParagraph(" test", 79, 0), "test");
+ BOOST_CHECK_EQUAL(FormatParagraph(" test", 79, 0), " test");
BOOST_CHECK_EQUAL(FormatParagraph("test test", 79, 0), "test test");
BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 0), "test\ntest");
- BOOST_CHECK_EQUAL(FormatParagraph("testerde test ", 4, 0), "testerde\ntest");
+ BOOST_CHECK_EQUAL(FormatParagraph("testerde test", 4, 0), "testerde\ntest");
BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 4), "test\n test");
- BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string. This is a second sentence in the very long test string."), "This is a very long test string. This is a second sentence in the very long\ntest string.");
+
+ // Make sure we don't indent a fully-new line following a too-long line ending
+ BOOST_CHECK_EQUAL(FormatParagraph("test test\nabc", 4, 4), "test\n test\nabc");
+
+ BOOST_CHECK_EQUAL(FormatParagraph("This_is_a_very_long_test_string_without_any_spaces_so_it_should_just_get_returned_as_is_despite_the_length until it gets here", 79), "This_is_a_very_long_test_string_without_any_spaces_so_it_should_just_get_returned_as_is_despite_the_length\nuntil it gets here");
+
+ // Test wrap length is exact
+ BOOST_CHECK_EQUAL(FormatParagraph("a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p", 79), "a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\nf g h i j k l m n o p");
+ BOOST_CHECK_EQUAL(FormatParagraph("x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p", 79), "x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\nf g h i j k l m n o p");
+ // Indent should be included in length of lines
+ BOOST_CHECK_EQUAL(FormatParagraph("x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e fg h i j k", 79, 4), "x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\n f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e fg\n h i j k");
+
+ BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string. This is a second sentence in the very long test string.", 79), "This is a very long test string. This is a second sentence in the very long\ntest string.");
+ BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string.\nThis is a second sentence in the very long test string. This is a third sentence in the very long test string.", 79), "This is a very long test string.\nThis is a second sentence in the very long test string. This is a third\nsentence in the very long test string.");
+ BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string.\n\nThis is a second sentence in the very long test string. This is a third sentence in the very long test string.", 79), "This is a very long test string.\n\nThis is a second sentence in the very long test string. This is a third\nsentence in the very long test string.");
+ BOOST_CHECK_EQUAL(FormatParagraph("Testing that normal newlines do not get indented.\nLike here.", 79), "Testing that normal newlines do not get indented.\nLike here.");
}
BOOST_AUTO_TEST_CASE(test_FormatSubVersion)
diff --git a/src/timedata.cpp b/src/timedata.cpp
index de8cc62b24..4d2f8d1e3b 100644
--- a/src/timedata.cpp
+++ b/src/timedata.cpp
@@ -2,6 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "timedata.h"
#include "netbase.h"
@@ -99,7 +103,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample)
if (!fMatch)
{
fDone = true;
- string strMessage = _("Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly.");
+ string strMessage = strprintf(_("Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly."), _(PACKAGE_NAME));
strMiscWarning = strMessage;
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);
}
diff --git a/src/util.cpp b/src/util.cpp
index 019c912f51..492697e12f 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -836,3 +836,14 @@ int GetNumCores()
#endif
}
+std::string CopyrightHolders(const std::string& strPrefix)
+{
+ std::string strCopyrightHolders = strPrefix + _(COPYRIGHT_HOLDERS);
+ if (strCopyrightHolders.find("%s") != strCopyrightHolders.npos) {
+ strCopyrightHolders = strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION));
+ }
+ if (strCopyrightHolders.find("Bitcoin Core developers") == strCopyrightHolders.npos) {
+ strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers";
+ }
+ return strCopyrightHolders;
+}
diff --git a/src/util.h b/src/util.h
index 4d3c029e9a..9da8fdf87a 100644
--- a/src/util.h
+++ b/src/util.h
@@ -247,4 +247,6 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
}
}
+std::string CopyrightHolders(const std::string& strPrefix);
+
#endif // BITCOIN_UTIL_H
diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp
index 130bc997ba..0f9334cbe3 100644
--- a/src/utilstrencodings.cpp
+++ b/src/utilstrencodings.cpp
@@ -478,34 +478,40 @@ bool ParseDouble(const std::string& str, double *out)
std::string FormatParagraph(const std::string& in, size_t width, size_t indent)
{
std::stringstream out;
- size_t col = 0;
size_t ptr = 0;
- while(ptr < in.size())
+ size_t indented = 0;
+ while (ptr < in.size())
{
- // Find beginning of next word
- ptr = in.find_first_not_of(' ', ptr);
- if (ptr == std::string::npos)
- break;
- // Find end of next word
- size_t endword = in.find_first_of(' ', ptr);
- if (endword == std::string::npos)
- endword = in.size();
- // Add newline and indentation if this wraps over the allowed width
- if (col > 0)
- {
- if ((col + endword - ptr) > width)
- {
- out << '\n';
- for(size_t i=0; i<indent; ++i)
- out << ' ';
- col = 0;
- } else
- out << ' ';
+ size_t lineend = in.find_first_of('\n', ptr);
+ if (lineend == std::string::npos) {
+ lineend = in.size();
+ }
+ const size_t linelen = lineend - ptr;
+ const size_t rem_width = width - indented;
+ if (linelen <= rem_width) {
+ out << in.substr(ptr, linelen + 1);
+ ptr = lineend + 1;
+ indented = 0;
+ } else {
+ size_t finalspace = in.find_last_of(" \n", ptr + rem_width);
+ if (finalspace == std::string::npos || finalspace < ptr) {
+ // No place to break; just include the entire word and move on
+ finalspace = in.find_first_of("\n ", ptr);
+ if (finalspace == std::string::npos) {
+ // End of the string, just add it and break
+ out << in.substr(ptr);
+ break;
+ }
+ }
+ out << in.substr(ptr, finalspace - ptr) << "\n";
+ if (in[finalspace] == '\n') {
+ indented = 0;
+ } else if (indent) {
+ out << std::string(indent, ' ');
+ indented = indent;
+ }
+ ptr = finalspace + 1;
}
- // Append word
- out << in.substr(ptr, endword - ptr);
- col += endword - ptr + 1;
- ptr = endword;
}
return out.str();
}
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp
index 81f3b775f4..8da0c72858 100644
--- a/src/validationinterface.cpp
+++ b/src/validationinterface.cpp
@@ -14,7 +14,7 @@ CMainSignals& GetMainSignals()
void RegisterValidationInterface(CValidationInterface* pwalletIn) {
g_signals.UpdatedBlockTip.connect(boost::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1));
- g_signals.SyncTransaction.connect(boost::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2));
+ g_signals.SyncTransaction.connect(boost::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2, _3));
g_signals.UpdatedTransaction.connect(boost::bind(&CValidationInterface::UpdatedTransaction, pwalletIn, _1));
g_signals.SetBestChain.connect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1));
g_signals.Inventory.connect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1));
@@ -32,7 +32,7 @@ void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
g_signals.Inventory.disconnect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1));
g_signals.SetBestChain.disconnect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1));
g_signals.UpdatedTransaction.disconnect(boost::bind(&CValidationInterface::UpdatedTransaction, pwalletIn, _1));
- g_signals.SyncTransaction.disconnect(boost::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2));
+ g_signals.SyncTransaction.disconnect(boost::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2, _3));
g_signals.UpdatedBlockTip.disconnect(boost::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1));
}
@@ -48,6 +48,6 @@ void UnregisterAllValidationInterfaces() {
g_signals.UpdatedBlockTip.disconnect_all_slots();
}
-void SyncWithWallets(const CTransaction &tx, const CBlock *pblock) {
- g_signals.SyncTransaction(tx, pblock);
+void SyncWithWallets(const CTransaction &tx, const CBlockIndex *pindex, const CBlock *pblock) {
+ g_signals.SyncTransaction(tx, pindex, pblock);
}
diff --git a/src/validationinterface.h b/src/validationinterface.h
index 4da145473b..01b8e47650 100644
--- a/src/validationinterface.h
+++ b/src/validationinterface.h
@@ -10,6 +10,7 @@
#include <boost/shared_ptr.hpp>
class CBlock;
+class CBlockIndex;
struct CBlockLocator;
class CBlockIndex;
class CReserveScript;
@@ -27,12 +28,12 @@ void UnregisterValidationInterface(CValidationInterface* pwalletIn);
/** Unregister all wallets from core */
void UnregisterAllValidationInterfaces();
/** Push an updated transaction to all registered wallets */
-void SyncWithWallets(const CTransaction& tx, const CBlock* pblock = NULL);
+void SyncWithWallets(const CTransaction& tx, const CBlockIndex *pindex, const CBlock* pblock = NULL);
class CValidationInterface {
protected:
virtual void UpdatedBlockTip(const CBlockIndex *pindex) {}
- virtual void SyncTransaction(const CTransaction &tx, const CBlock *pblock) {}
+ virtual void SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, const CBlock *pblock) {}
virtual void SetBestChain(const CBlockLocator &locator) {}
virtual void UpdatedTransaction(const uint256 &hash) {}
virtual void Inventory(const uint256 &hash) {}
@@ -49,7 +50,7 @@ struct CMainSignals {
/** Notifies listeners of updated block chain tip */
boost::signals2::signal<void (const CBlockIndex *)> UpdatedBlockTip;
/** Notifies listeners of updated transaction data (transaction, and optionally the block it is found in. */
- boost::signals2::signal<void (const CTransaction &, const CBlock *)> SyncTransaction;
+ boost::signals2::signal<void (const CTransaction &, const CBlockIndex *pindex, const CBlock *)> SyncTransaction;
/** Notifies listeners of an updated transaction without new data (for now: a coinbase potentially becoming visible). */
boost::signals2::signal<void (const uint256 &)> UpdatedTransaction;
/** Notifies listeners of a new active block chain. */
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index dd9d549f66..65defc30aa 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -846,14 +846,19 @@ void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx)
{
LOCK2(cs_main, cs_wallet);
- CBlockIndex* pindex;
- assert(mapBlockIndex.count(hashBlock));
- pindex = mapBlockIndex[hashBlock];
int conflictconfirms = 0;
- if (chainActive.Contains(pindex)) {
- conflictconfirms = -(chainActive.Height() - pindex->nHeight + 1);
+ if (mapBlockIndex.count(hashBlock)) {
+ CBlockIndex* pindex = mapBlockIndex[hashBlock];
+ if (chainActive.Contains(pindex)) {
+ conflictconfirms = -(chainActive.Height() - pindex->nHeight + 1);
+ }
}
- assert(conflictconfirms < 0);
+ // If number of conflict confirms cannot be determined, this means
+ // that the block is still unknown or not yet part of the main chain,
+ // for example when loading the wallet during a reindex. Do nothing in that
+ // case.
+ if (conflictconfirms >= 0)
+ return;
// Do not flush the wallet here for performance reasons
CWalletDB walletdb(strWalletFile, "r+", false);
@@ -896,7 +901,7 @@ void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx)
}
}
-void CWallet::SyncTransaction(const CTransaction& tx, const CBlock* pblock)
+void CWallet::SyncTransaction(const CTransaction& tx, const CBlockIndex *pindex, const CBlock* pblock)
{
LOCK2(cs_main, cs_wallet);
@@ -1251,7 +1256,7 @@ void CWallet::ReacceptWalletTransactions()
CWalletTx& wtx = *(item.second);
LOCK(mempool.cs);
- wtx.AcceptToMemoryPool(false);
+ wtx.AcceptToMemoryPool(false, maxTxFee);
}
}
@@ -2268,7 +2273,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
if (fBroadcastTransactions)
{
// Broadcast
- if (!wtxNew.AcceptToMemoryPool(false))
+ if (!wtxNew.AcceptToMemoryPool(false, maxTxFee))
{
// This must not fail. The transaction has already been signed and recorded.
LogPrintf("CommitTransaction(): Error: Transaction not valid\n");
@@ -3025,8 +3030,8 @@ int CMerkleTx::GetBlocksToMaturity() const
}
-bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, bool fRejectAbsurdFee)
+bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, CAmount nAbsurdFee)
{
CValidationState state;
- return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, false, fRejectAbsurdFee);
+ return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, false, nAbsurdFee);
}
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 28d2f8a04f..990b27c7ce 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -204,8 +204,8 @@ public:
int GetDepthInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); }
bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet) > 0; }
int GetBlocksToMaturity() const;
- /** Pass this transaction to the mempool. Fails if absolute fee exceeds maxTxFee. */
- bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectAbsurdFee=true);
+ /** Pass this transaction to the mempool. Fails if absolute fee exceeds absurd fee. */
+ bool AcceptToMemoryPool(bool fLimitFree, const CAmount nAbsurdFee);
bool hashUnset() const { return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); }
bool isAbandoned() const { return (hashBlock == ABANDON_HASH); }
void setAbandoned() { hashBlock = ABANDON_HASH; }
@@ -718,7 +718,7 @@ public:
void MarkDirty();
bool AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletDB* pwalletdb);
- void SyncTransaction(const CTransaction& tx, const CBlock* pblock);
+ void SyncTransaction(const CTransaction& tx, const CBlockIndex *pindex, const CBlock* pblock);
bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate);
int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
void ReacceptWalletTransactions();
diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp
index be2aec7d15..c8adcf8462 100644
--- a/src/zmq/zmqnotificationinterface.cpp
+++ b/src/zmq/zmqnotificationinterface.cpp
@@ -142,7 +142,7 @@ void CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindex)
}
}
-void CZMQNotificationInterface::SyncTransaction(const CTransaction &tx, const CBlock *pblock)
+void CZMQNotificationInterface::SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, const CBlock* pblock)
{
for (std::list<CZMQAbstractNotifier*>::iterator i = notifiers.begin(); i!=notifiers.end(); )
{
diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h
index 3ccfaf341d..7b52e7775b 100644
--- a/src/zmq/zmqnotificationinterface.h
+++ b/src/zmq/zmqnotificationinterface.h
@@ -24,7 +24,7 @@ protected:
void Shutdown();
// CValidationInterface
- void SyncTransaction(const CTransaction &tx, const CBlock *pblock);
+ void SyncTransaction(const CTransaction& tx, const CBlockIndex *pindex, const CBlock* pblock);
void UpdatedBlockTip(const CBlockIndex *pindex);
private: