diff options
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | build-aux/m4/bitcoin_find_bdb48.m4 | 2 | ||||
-rw-r--r-- | build-aux/m4/bitcoin_qt.m4 | 194 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rwxr-xr-x | contrib/install_db4.sh | 4 | ||||
-rw-r--r-- | doc/build-netbsd.md | 49 | ||||
-rw-r--r-- | src/addrman.cpp | 8 | ||||
-rw-r--r-- | src/bench/bench.cpp | 3 | ||||
-rw-r--r-- | src/bitcoin-tx.cpp | 12 | ||||
-rw-r--r-- | src/chainparams.cpp | 16 | ||||
-rw-r--r-- | src/checkqueue.h | 7 | ||||
-rw-r--r-- | src/httprpc.cpp | 10 | ||||
-rw-r--r-- | src/init.cpp | 8 | ||||
-rw-r--r-- | src/rest.cpp | 4 | ||||
-rw-r--r-- | src/rpc/client.cpp | 2 | ||||
-rw-r--r-- | src/rpc/net.cpp | 2 | ||||
-rw-r--r-- | src/wallet/rpcwallet.cpp | 2 | ||||
-rwxr-xr-x | test/functional/mempool_persist.py | 9 | ||||
-rwxr-xr-x | test/functional/wallet_zapwallettxes.py | 1 |
20 files changed, 218 insertions, 126 deletions
diff --git a/.gitignore b/.gitignore index ff297fbeca..d083c63ea0 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,12 @@ src/qt/forms/ui_*.h src/qt/test/moc*.cpp +src/qt/bitcoin-qt.config +src/qt/bitcoin-qt.creator +src/qt/bitcoin-qt.creator.user +src/qt/bitcoin-qt.files +src/qt/bitcoin-qt.includes + .deps .dirstamp .libs diff --git a/.travis.yml b/.travis.yml index ab002acc53..0332a0e204 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,7 @@ script: - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib - if [ "$RUN_TESTS" = "true" ]; then travis_wait 30 make $MAKEJOBS check VERBOSE=1; fi - - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude pruning,dbcrash"; fi + - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude feature_pruning,feature_dbcrash"; fi - if [ "$RUN_TESTS" = "true" ]; then test/functional/test_runner.py --combinedlogslen=4000 --coverage --quiet ${extended}; fi after_script: - echo $TRAVIS_COMMIT_RANGE diff --git a/build-aux/m4/bitcoin_find_bdb48.m4 b/build-aux/m4/bitcoin_find_bdb48.m4 index b9bf7bf46e..ea9c795daa 100644 --- a/build-aux/m4/bitcoin_find_bdb48.m4 +++ b/build-aux/m4/bitcoin_find_bdb48.m4 @@ -64,7 +64,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ if test "x$BDB_LIBS" = "x"; then # TODO: Ideally this could find the library version and make sure it matches the headers being used - for searchlib in db_cxx-4.8 db_cxx; do + for searchlib in db_cxx-4.8 db_cxx db4_cxx; do AC_CHECK_LIB([$searchlib],[main],[ BDB_LIBS="-l${searchlib}" break diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index f83dba076f..f41508336c 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -5,8 +5,8 @@ dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. dnl Helper for cases where a qt dependency is not met. dnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit. AC_DEFUN([BITCOIN_QT_FAIL],[ - if test "x$bitcoin_qt_want_version" = "xauto" && test x$bitcoin_qt_force != xyes; then - if test x$bitcoin_enable_qt != xno; then + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then AC_MSG_WARN([$1; bitcoin-qt frontend will not be built]) fi bitcoin_enable_qt=no @@ -17,7 +17,7 @@ AC_DEFUN([BITCOIN_QT_FAIL],[ ]) AC_DEFUN([BITCOIN_QT_CHECK],[ - if test "x$bitcoin_enable_qt" != "xno" && test x$bitcoin_qt_want_version != xno; then + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then true $1 else @@ -35,12 +35,12 @@ dnl Inputs: $4: If "yes", don't fail if $2 is not found. dnl Output: $1 is set to the path of $2 if found. $2 are searched in order. AC_DEFUN([BITCOIN_QT_PATH_PROGS],[ BITCOIN_QT_CHECK([ - if test "x$3" != "x"; then + if test "x$3" != x; then AC_PATH_PROGS($1,$2,,$3) else AC_PATH_PROGS($1,$2) fi - if test "x$$1" = "x" && test "x$4" != "xyes"; then + if test "x$$1" = x && test "x$4" != xyes; then BITCOIN_QT_FAIL([$1 not found]) fi ]) @@ -57,7 +57,7 @@ AC_DEFUN([BITCOIN_QT_INIT],[ [build bitcoin-qt GUI (default=auto, qt5 tried first)])], [ bitcoin_qt_want_version=$withval - if test x$bitcoin_qt_want_version = xyes; then + if test "x$bitcoin_qt_want_version" = xyes; then bitcoin_qt_force=yes bitcoin_qt_want_version=auto fi @@ -89,11 +89,11 @@ dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test AC_DEFUN([BITCOIN_QT_CONFIGURE],[ use_pkgconfig=$1 - if test x$use_pkgconfig = x; then + if test "x$use_pkgconfig" = x; then use_pkgconfig=yes fi - if test x$use_pkgconfig = xyes; then + if test "x$use_pkgconfig" = xyes; then BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([$2])]) else BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG]) @@ -113,39 +113,45 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ TEMP_CXXFLAGS=$CXXFLAGS CPPFLAGS="$QT_INCLUDES $CPPFLAGS" CXXFLAGS="$PIC_FLAGS $CXXFLAGS" - if test x$bitcoin_qt_got_major_vers = x5; then + if test "x$bitcoin_qt_got_major_vers" = x5; then _BITCOIN_QT_IS_STATIC - if test x$bitcoin_cv_static_qt = xyes; then + if test "x$bitcoin_cv_static_qt" = xyes; then _BITCOIN_QT_FIND_STATIC_PLUGINS AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) - AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[#include <QtCore>]],[[ - #if QT_VERSION >= 0x050400 - choke; - #endif + AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <QtCore/qconfig.h> + #ifndef QT_VERSION + # include <QtCore/qglobal.h> + #endif + ]], + [[ + #if QT_VERSION >= 0x050400 + choke + #endif ]])], [bitcoin_cv_need_acc_widget=yes], [bitcoin_cv_need_acc_widget=no]) ]) - if test "x$bitcoin_cv_need_acc_widget" = "xyes"; then + if test "x$bitcoin_cv_need_acc_widget" = xyes; then _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets]) fi _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal]) AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists]) - if test x$TARGET_OS = xwindows; then + if test "x$TARGET_OS" = xwindows; then _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows]) - elif test x$TARGET_OS = xlinux; then + elif test "x$TARGET_OS" = xlinux; then _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static]) AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb]) - elif test x$TARGET_OS = xdarwin; then + elif test "x$TARGET_OS" = xdarwin; then AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)]) _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa]) AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa]) fi fi else - if test x$TARGET_OS = xwindows; then + if test "x$TARGET_OS" = xwindows; then AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(qcncodecs) @@ -160,24 +166,29 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ CXXFLAGS=$TEMP_CXXFLAGS ]) - if test x$use_pkgconfig$qt_bin_path = xyes; then - if test x$bitcoin_qt_got_major_vers = x5; then + if test "x$use_pkgconfig$qt_bin_path" = xyes; then + if test "x$bitcoin_qt_got_major_vers" = x5; then qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`" fi fi - if test x$use_hardening != xno; then + if test "x$use_hardening" != xno; then BITCOIN_QT_CHECK([ AC_MSG_CHECKING(whether -fPIE can be used with this Qt config) TEMP_CPPFLAGS=$CPPFLAGS TEMP_CXXFLAGS=$CXXFLAGS CPPFLAGS="$QT_INCLUDES $CPPFLAGS" CXXFLAGS="$PIE_FLAGS $CXXFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <QtCore/qconfig.h>]], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <QtCore/qconfig.h> + #ifndef QT_VERSION + # include <QtCore/qglobal.h> + #endif + ]], [[ - #if defined(QT_REDUCE_RELOCATIONS) - choke; - #endif + #if defined(QT_REDUCE_RELOCATIONS) + choke + #endif ]])], [ AC_MSG_RESULT(yes); QT_PIE_FLAGS=$PIE_FLAGS ], [ AC_MSG_RESULT(no); QT_PIE_FLAGS=$PIC_FLAGS] @@ -190,11 +201,16 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ AC_MSG_CHECKING(whether -fPIC is needed with this Qt config) TEMP_CPPFLAGS=$CPPFLAGS CPPFLAGS="$QT_INCLUDES $CPPFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <QtCore/qconfig.h>]], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <QtCore/qconfig.h> + #ifndef QT_VERSION + # include <QtCore/qglobal.h> + #endif + ]], [[ - #if defined(QT_REDUCE_RELOCATIONS) - choke; - #endif + #if defined(QT_REDUCE_RELOCATIONS) + choke + #endif ]])], [ AC_MSG_RESULT(no)], [ AC_MSG_RESULT(yes); QT_PIE_FLAGS=$PIC_FLAGS] @@ -230,18 +246,18 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ BITCOIN_QT_CHECK([ bitcoin_enable_qt=yes bitcoin_enable_qt_test=yes - if test x$have_qt_test = xno; then + if test "x$have_qt_test" = xno; then bitcoin_enable_qt_test=no fi bitcoin_enable_qt_dbus=no - if test x$use_dbus != xno && test x$have_qt_dbus = xyes; then + if test "x$use_dbus" != xno && test "x$have_qt_dbus" = xyes; then bitcoin_enable_qt_dbus=yes fi - if test x$use_dbus = xyes && test x$have_qt_dbus = xno; then - AC_MSG_ERROR("libQtDBus not found. Install libQtDBus or remove --with-qtdbus.") + if test "x$use_dbus" = xyes && test "x$have_qt_dbus" = xno; then + AC_MSG_ERROR([libQtDBus not found. Install libQtDBus or remove --with-qtdbus.]) fi - if test x$LUPDATE = x; then - AC_MSG_WARN("lupdate is required to update qt translations") + if test "x$LUPDATE" = x; then + AC_MSG_WARN([lupdate is required to update qt translations]) fi ],[ bitcoin_enable_qt=no @@ -269,13 +285,15 @@ dnl Requires: INCLUDES must be populated as necessary. dnl Output: bitcoin_cv_qt5=yes|no AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[ AC_CACHE_CHECK(for Qt 5, bitcoin_cv_qt5,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[#include <QtCore>]], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <QtCore/qconfig.h> + #ifndef QT_VERSION + # include <QtCore/qglobal.h> + #endif + ]], [[ #if QT_VERSION < 0x050000 - choke me - #else - return 0; + choke #endif ]])], [bitcoin_cv_qt5=yes], @@ -289,19 +307,21 @@ dnl Output: bitcoin_cv_static_qt=yes|no dnl Output: Defines QT_STATICPLUGIN if plugins are static. AC_DEFUN([_BITCOIN_QT_IS_STATIC],[ AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[#include <QtCore>]], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <QtCore/qconfig.h> + #ifndef QT_VERSION + # include <QtCore/qglobal.h> + #endif + ]], [[ - #if defined(QT_STATIC) - return 0; - #else - choke me + #if !defined(QT_STATIC) + choke #endif ]])], [bitcoin_cv_static_qt=yes], [bitcoin_cv_static_qt=no]) ]) - if test xbitcoin_cv_static_qt = xyes; then + if test "x$bitcoin_cv_static_qt" = xyes; then AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol for static Qt plugins]) fi ]) @@ -330,44 +350,50 @@ dnl Inputs: bitcoin_qt_got_major_vers. 4 or 5. dnl Inputs: qt_plugin_path. optional. dnl Outputs: QT_LIBS is appended AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[ - if test x$bitcoin_qt_got_major_vers = x5; then - if test x$qt_plugin_path != x; then + if test "x$bitcoin_qt_got_major_vers" = x5; then + if test "x$qt_plugin_path" != x; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms" if test -d "$qt_plugin_path/accessible"; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" fi fi - if test x$use_pkgconfig = xyes; then + if test "x$use_pkgconfig" = xyes; then : dnl m4_ifdef([PKG_CHECK_MODULES],[ PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) - if test x$TARGET_OS = xlinux; then + if test "x$TARGET_OS" = xlinux; then PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"]) if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"]) fi - elif test x$TARGET_OS = xdarwin; then + elif test "x$TARGET_OS" = xdarwin; then PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"]) fi ]) else - if test x$TARGET_OS = xwindows; then - AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[#include <QtCore>]],[[ - #if QT_VERSION < 0x050600 - choke; - #endif + if test "x$TARGET_OS" = xwindows; then + AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <QtCore/qconfig.h> + #ifndef QT_VERSION + # include <QtCore/qglobal.h> + #endif + ]], + [[ + #if QT_VERSION < 0x050600 + choke + #endif ]])], [bitcoin_cv_need_platformsupport=yes], [bitcoin_cv_need_platformsupport=no]) ]) - if test x$bitcoin_cv_need_platformsupport = xyes; then - BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXPlatformSupport not found))) + if test "x$bitcoin_cv_need_platformsupport" = xyes; then + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}PlatformSupport not found))) fi fi fi else - if test x$qt_plugin_path != x; then + if test "x$qt_plugin_path" != x; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs" fi @@ -385,10 +411,10 @@ dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ m4_ifdef([PKG_CHECK_MODULES],[ auto_priority_version=$1 - if test x$auto_priority_version = x; then + if test "x$auto_priority_version" = x; then auto_priority_version=qt5 fi - if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then + if test "x$bitcoin_qt_want_version" = xqt5 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt5 ); then QT_LIB_PREFIX=Qt5 bitcoin_qt_got_major_vers=5 else @@ -398,28 +424,28 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" qt4_modules="QtCore QtGui QtNetwork" BITCOIN_QT_CHECK([ - if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then + if test "x$bitcoin_qt_want_version" = xqt5 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt5 ); then PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes],[have_qt=no]) - elif test x$bitcoin_qt_want_version = xqt4 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt4 ); then + elif test "x$bitcoin_qt_want_version" = xqt4 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt4 ); then PKG_CHECK_MODULES([QT4], [$qt4_modules], [QT_INCLUDES="$QT4_CFLAGS"; QT_LIBS="$QT4_LIBS" ; have_qt=yes], [have_qt=no]) fi dnl qt version is set to 'auto' and the preferred version wasn't found. Now try the other. - if test x$have_qt = xno && test x$bitcoin_qt_want_version = xauto; then - if test x$auto_priority_version = xqt5; then + if test "x$have_qt" = xno && test "x$bitcoin_qt_want_version" = xauto; then + if test "x$auto_priority_version" = xqt5; then PKG_CHECK_MODULES([QT4], [$qt4_modules], [QT_INCLUDES="$QT4_CFLAGS"; QT_LIBS="$QT4_LIBS" ; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no]) else PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" ; have_qt=yes; QT_LIB_PREFIX=Qt5; bitcoin_qt_got_major_vers=5], [have_qt=no]) fi fi - if test x$have_qt != xyes; then + if test "x$have_qt" != xyes; then have_qt=no BITCOIN_QT_FAIL([Qt dependencies not found]) fi ]) BITCOIN_QT_CHECK([ PKG_CHECK_MODULES([QT_TEST], [${QT_LIB_PREFIX}Test], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no]) - if test x$use_dbus != xno; then + if test "x$use_dbus" != xno; then PKG_CHECK_MODULES([QT_DBUS], [${QT_LIB_PREFIX}DBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no]) fi ]) @@ -440,7 +466,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ CXXFLAGS="$PIC_FLAGS $CXXFLAGS" TEMP_LIBS="$LIBS" BITCOIN_QT_CHECK([ - if test x$qt_include_path != x; then + if test "x$qt_include_path" != x; then QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus" CPPFLAGS="$QT_INCLUDES $CPPFLAGS" fi @@ -451,10 +477,10 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))]) BITCOIN_QT_CHECK([ - if test x$bitcoin_qt_want_version = xauto; then + if test "x$bitcoin_qt_want_version" = xauto; then _BITCOIN_QT_CHECK_QT5 fi - if test x$bitcoin_cv_qt5 = xyes || test x$bitcoin_qt_want_version = xqt5; then + if test "x$bitcoin_cv_qt5" = xyes || test "x$bitcoin_qt_want_version" = xqt5; then QT_LIB_PREFIX=Qt5 bitcoin_qt_got_major_vers=5 else @@ -465,11 +491,11 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ BITCOIN_QT_CHECK([ LIBS= - if test x$qt_lib_path != x; then + if test "x$qt_lib_path" != x; then LIBS="$LIBS -L$qt_lib_path" fi - if test x$TARGET_OS = xwindows; then + if test "x$TARGET_OS" = xwindows; then AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found)) fi ]) @@ -479,26 +505,26 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ BITCOIN_QT_CHECK(AC_SEARCH_LIBS([jpeg_create_decompress] ,[qtjpeg jpeg],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in]))) BITCOIN_QT_CHECK(AC_SEARCH_LIBS([pcre16_exec], [qtpcre pcre16],,AC_MSG_WARN([libpcre16 not found. Assuming qt has it built-in]))) BITCOIN_QT_CHECK(AC_SEARCH_LIBS([hb_ot_tags_from_script] ,[qtharfbuzzng harfbuzz],,AC_MSG_WARN([libharfbuzz not found. Assuming qt has it built-in or support is disabled]))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXNetwork not found))) - if test x$bitcoin_qt_got_major_vers = x5; then - BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXWidgets not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Core not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found))) + if test "x$bitcoin_qt_got_major_vers" = x5; then + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found))) fi QT_LIBS="$LIBS" LIBS="$TEMP_LIBS" BITCOIN_QT_CHECK([ LIBS= - if test x$qt_lib_path != x; then + if test "x$qt_lib_path" != x; then LIBS="-L$qt_lib_path" fi AC_CHECK_LIB([${QT_LIB_PREFIX}Test], [main],, have_qt_test=no) AC_CHECK_HEADER([QTest],, have_qt_test=no) QT_TEST_LIBS="$LIBS" - if test x$use_dbus != xno; then + if test "x$use_dbus" != xno; then LIBS= - if test x$qt_lib_path != x; then + if test "x$qt_lib_path" != x; then LIBS="-L$qt_lib_path" fi AC_CHECK_LIB([${QT_LIB_PREFIX}DBus], [main],, have_qt_dbus=no) diff --git a/configure.ac b/configure.ac index 256aed40b2..8e779f3225 100644 --- a/configure.ac +++ b/configure.ac @@ -449,6 +449,9 @@ case $host in *openbsd*) LEVELDB_TARGET_FLAGS="-DOS_OPENBSD" ;; + *netbsd*) + LEVELDB_TARGET_FLAGS="-DOS_NETBSD" + ;; *) OTHER_OS=`echo ${host_os} | awk '{print toupper($0)}'` AC_MSG_WARN([Guessing LevelDB OS as OS_${OTHER_OS}, please check whether this is correct, if not add an entry to configure.ac.]) diff --git a/contrib/install_db4.sh b/contrib/install_db4.sh index b57ade139d..d315a7d3b7 100755 --- a/contrib/install_db4.sh +++ b/contrib/install_db4.sh @@ -72,7 +72,7 @@ patch -p2 < clang.patch cd build_unix/ "${BDB_PREFIX}/${BDB_VERSION}/dist/configure" \ - --enable-cxx --disable-shared --with-pic --prefix="${BDB_PREFIX}" \ + --enable-cxx --disable-shared --disable-replication --with-pic --prefix="${BDB_PREFIX}" \ "${@}" make install @@ -83,4 +83,4 @@ echo echo 'When compiling bitcoind, run `./configure` in the following way:' echo echo " export BDB_PREFIX='${BDB_PREFIX}'" -echo ' ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" ...' +echo ' ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...' diff --git a/doc/build-netbsd.md b/doc/build-netbsd.md new file mode 100644 index 0000000000..5bf2d6b59b --- /dev/null +++ b/doc/build-netbsd.md @@ -0,0 +1,49 @@ +NetBSD build guide +====================== +(updated for NetBSD 7.0) + +This guide describes how to build bitcoind and command-line utilities on NetBSD. + +This guide does not contain instructions for building the GUI. + +Preparation +------------- + +You will need the following modules, which can be installed via pkgsrc or pkgin: + +``` +autoconf +automake +boost +db4 +git +gmake +libevent +libtool +python27 +``` + +Download the source code: +``` +git clone https://github.com/bitcoin/bitcoin +``` + +See [dependencies.md](dependencies.md) for a complete overview. + +### Building Bitcoin Core + +**Important**: Use `gmake` (the non-GNU `make` will exit with an error). + +With wallet: +``` +./autogen.sh +./configure CPPFLAGS="-I/usr/pkg/include" LDFLAGS="-L/usr/pkg/lib" BOOST_CPPFLAGS="-I/usr/pkg/include" BOOST_LDFLAGS="-L/usr/pkg/lib" +gmake +``` + +Without wallet: +``` +./autogen.sh +./configure --disable-wallet CPPFLAGS="-I/usr/pkg/include" LDFLAGS="-L/usr/pkg/lib" BOOST_CPPFLAGS="-I/usr/pkg/include" BOOST_LDFLAGS="-L/usr/pkg/lib" +gmake +``` diff --git a/src/addrman.cpp b/src/addrman.cpp index 5a769ac93a..9eefffb45b 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -387,7 +387,7 @@ int CAddrMan::Check_() std::set<int> setTried; std::map<int, int> mapNew; - if (vRandom.size() != nTried + nNew) + if (vRandom.size() != (size_t)(nTried + nNew)) return -7; for (const auto& entry : mapInfo) { @@ -408,7 +408,7 @@ int CAddrMan::Check_() } if (mapAddr[info] != n) return -5; - if (info.nRandomPos < 0 || info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n) + if (info.nRandomPos < 0 || (size_t)info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n) return -14; if (info.nLastTry < 0) return -6; @@ -416,9 +416,9 @@ int CAddrMan::Check_() return -8; } - if (setTried.size() != nTried) + if (setTried.size() != (size_t)nTried) return -9; - if (mapNew.size() != nNew) + if (mapNew.size() != (size_t)nNew) return -10; for (int n = 0; n < ADDRMAN_TRIED_BUCKET_COUNT; n++) { diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index dd120f3590..21329a5151 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -100,6 +100,9 @@ void benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double if (!std::ratio_less_equal<benchmark::clock::period, std::micro>::value) { std::cerr << "WARNING: Clock precision is worse than microsecond - benchmarks may be less accurate!\n"; } +#ifdef DEBUG + std::cerr << "WARNING: This is a debug build - may result in slower benchmarks.\n"; +#endif std::regex reFilter(filter); std::smatch baseMatch; diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 9bcf3fe8dd..f1cf7c9d2d 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -305,8 +305,8 @@ static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& str bool bScriptHash = false; if (vStrInputParts.size() == 3) { std::string flags = vStrInputParts[2]; - bSegWit = (flags.find("W") != std::string::npos); - bScriptHash = (flags.find("S") != std::string::npos); + bSegWit = (flags.find('W') != std::string::npos); + bScriptHash = (flags.find('S') != std::string::npos); } if (bSegWit) { @@ -367,8 +367,8 @@ static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& s bool bScriptHash = false; if (vStrInputParts.size() == numkeys + 4) { std::string flags = vStrInputParts.back(); - bSegWit = (flags.find("W") != std::string::npos); - bScriptHash = (flags.find("S") != std::string::npos); + bSegWit = (flags.find('W') != std::string::npos); + bScriptHash = (flags.find('S') != std::string::npos); } else if (vStrInputParts.size() > numkeys + 4) { // Validate that there were no more parameters passed @@ -447,8 +447,8 @@ static void MutateTxAddOutScript(CMutableTransaction& tx, const std::string& str bool bScriptHash = false; if (vStrInputParts.size() == 3) { std::string flags = vStrInputParts.back(); - bSegWit = (flags.find("W") != std::string::npos); - bScriptHash = (flags.find("S") != std::string::npos); + bSegWit = (flags.find('W') != std::string::npos); + bScriptHash = (flags.find('S') != std::string::npos); } if (scriptPubKey.size() > MAX_SCRIPT_SIZE) { diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 4d2c079845..96e9b2727b 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -169,11 +169,11 @@ public: }; chainTxData = ChainTxData{ - // Data as of block 000000000000000000d97e53664d17967bd4ee50b23abb92e54a34eb222d15ae (height 478913). - 1501801925, // * UNIX timestamp of last known number of transactions - 243756039, // * total number of transactions between genesis and that timestamp + // Data as of block 0000000000000000002d6cca6761c99b3c2e936f9a0e304b7c7651a993f461de (height 506081). + 1516903077, // * UNIX timestamp of last known number of transactions + 295363220, // * total number of transactions between genesis and that timestamp // (the tx=... number in the SetBestChain debug.log lines) - 3.1 // * estimated number of transactions per second after that timestamp + 3.5 // * estimated number of transactions per second after that timestamp }; } }; @@ -260,10 +260,10 @@ public: }; chainTxData = ChainTxData{ - // Data as of block 00000000000001c200b9790dc637d3bb141fe77d155b966ed775b17e109f7c6c (height 1156179) - 1501802953, - 14706531, - 0.15 + // Data as of block 000000000000033cfa3c975eb83ecf2bb4aaedf68e6d279f6ed2b427c64caff9 (height 1260526) + 1516903490, + 17082348, + 0.09 }; } diff --git a/src/checkqueue.h b/src/checkqueue.h index 9b4a460bae..7500bae60e 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -59,9 +59,6 @@ private: */ unsigned int nTodo; - //! Whether we're shutting down. - bool fQuit; - //! The maximum number of elements to be processed in one batch unsigned int nBatchSize; @@ -89,7 +86,7 @@ private: } // logically, the do loop starts here while (queue.empty()) { - if ((fMaster || fQuit) && nTodo == 0) { + if (fMaster && nTodo == 0) { nTotal--; bool fRet = fAllOk; // reset the status for new work later @@ -131,7 +128,7 @@ public: boost::mutex ControlMutex; //! Create a new check queue - explicit CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), fQuit(false), nBatchSize(nBatchSizeIn) {} + explicit CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), nBatchSize(nBatchSizeIn) {} //! Worker thread void Thread() diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 66f7a6a718..5e9e419744 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -85,11 +85,11 @@ static void JSONErrorReply(HTTPRequest* req, const UniValue& objError, const Uni //entries from config file. static bool multiUserAuthorized(std::string strUserPass) { - if (strUserPass.find(":") == std::string::npos) { + if (strUserPass.find(':') == std::string::npos) { return false; } - std::string strUser = strUserPass.substr(0, strUserPass.find(":")); - std::string strPass = strUserPass.substr(strUserPass.find(":") + 1); + std::string strUser = strUserPass.substr(0, strUserPass.find(':')); + std::string strPass = strUserPass.substr(strUserPass.find(':') + 1); for (const std::string& strRPCAuth : gArgs.GetArgs("-rpcauth")) { //Search for multi-user login/pass "rpcauth" from config @@ -132,8 +132,8 @@ static bool RPCAuthorized(const std::string& strAuth, std::string& strAuthUserna boost::trim(strUserPass64); std::string strUserPass = DecodeBase64(strUserPass64); - if (strUserPass.find(":") != std::string::npos) - strAuthUsernameOut = strUserPass.substr(0, strUserPass.find(":")); + if (strUserPass.find(':') != std::string::npos) + strAuthUsernameOut = strUserPass.substr(0, strUserPass.find(':')); //Check if authorized under single-user field if (TimingResistantEqual(strUserPass, strRPCUserColonPass)) { diff --git a/src/init.cpp b/src/init.cpp index d1d733af94..94702301a6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -808,7 +808,13 @@ void InitLogging() fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS); LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); - LogPrintf("Bitcoin version %s\n", FormatFullVersion()); + std::string version_string = FormatFullVersion(); +#ifdef DEBUG + version_string += " (debug build)"; +#else + version_string += " (release build)"; +#endif + LogPrintf(PACKAGE_NAME " version %s\n", version_string); } namespace { // Variables internal to initialization process only diff --git a/src/rest.cpp b/src/rest.cpp index 0c93ce020e..30e481171f 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -423,8 +423,8 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart) { uint256 txid; int32_t nOutput; - std::string strTxid = uriParts[i].substr(0, uriParts[i].find("-")); - std::string strOutput = uriParts[i].substr(uriParts[i].find("-")+1); + std::string strTxid = uriParts[i].substr(0, uriParts[i].find('-')); + std::string strOutput = uriParts[i].substr(uriParts[i].find('-')+1); if (!ParseInt32(strOutput, &nOutput) || !IsHex(strTxid)) return RESTERR(req, HTTP_BAD_REQUEST, "Parse error"); diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index f63e970bdd..b88c1bccd5 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -213,7 +213,7 @@ UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector<s UniValue params(UniValue::VOBJ); for (const std::string &s: strParams) { - size_t pos = s.find("="); + size_t pos = s.find('='); if (pos == std::string::npos) { throw(std::runtime_error("No '=' in named argument '"+s+"', this needs to be present for every argument (even if it is empty)")); } diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index a81b651981..59b376c59a 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -516,7 +516,7 @@ UniValue setban(const JSONRPCRequest& request) CNetAddr netAddr; bool isSubnet = false; - if (request.params[0].get_str().find("/") != std::string::npos) + if (request.params[0].get_str().find('/') != std::string::npos) isSubnet = true; if (!isSubnet) { diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index fcee22a14a..9364d18d30 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2768,7 +2768,7 @@ UniValue getwalletinfo(const JSONRPCRequest& request) " \"keypoolsize_hd_internal\": xxxx, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)\n" " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" " \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in " + CURRENCY_UNIT + "/kB\n" - " \"hdmasterkeyid\": \"<hash160>\" (string) the Hash160 of the HD master pubkey\n" + " \"hdmasterkeyid\": \"<hash160>\" (string, optional) the Hash160 of the HD master pubkey (only present when HD is enabled)\n" "}\n" "\nExamples:\n" + HelpExampleCli("getwalletinfo", "") diff --git a/test/functional/mempool_persist.py b/test/functional/mempool_persist.py index 31a96ec60e..17f0967219 100755 --- a/test/functional/mempool_persist.py +++ b/test/functional/mempool_persist.py @@ -66,16 +66,17 @@ class MempoolPersistTest(BitcoinTestFramework): self.log.debug("Stop-start the nodes. Verify that node0 has the transactions in its mempool and node1 does not. Verify that node2 calculates its balance correctly after loading wallet transactions.") self.stop_nodes() + self.start_node(1) # Give this one a head-start, so we can be "extra-sure" that it didn't load anything later self.start_node(0) - self.start_node(1) self.start_node(2) # Give bitcoind a second to reload the mempool - time.sleep(1) - wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5) - wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5) + wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5, timeout=1) + wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5, timeout=1) + # The others have loaded their mempool. If node_1 loaded anything, we'd probably notice by now: assert_equal(len(self.nodes[1].getrawmempool()), 0) # Verify accounting of mempool transactions after restart is correct + self.nodes[2].syncwithvalidationinterfacequeue() # Flush mempool to wallet assert_equal(node2_balance, self.nodes[2].getbalance()) self.log.debug("Stop-start node0 with -persistmempool=0. Verify that it doesn't load its mempool.dat file.") diff --git a/test/functional/wallet_zapwallettxes.py b/test/functional/wallet_zapwallettxes.py index 08afb87894..87f44b2737 100755 --- a/test/functional/wallet_zapwallettxes.py +++ b/test/functional/wallet_zapwallettxes.py @@ -59,6 +59,7 @@ class ZapWalletTXesTest (BitcoinTestFramework): self.start_node(0, ["-persistmempool=1", "-zapwallettxes=2"]) wait_until(lambda: self.nodes[0].getmempoolinfo()['size'] == 1, timeout=3) + self.nodes[0].syncwithvalidationinterfacequeue() # Flush mempool to wallet assert_equal(self.nodes[0].gettransaction(txid1)['txid'], txid1) assert_equal(self.nodes[0].gettransaction(txid2)['txid'], txid2) |