diff options
113 files changed, 3115 insertions, 1480 deletions
diff --git a/.gitignore b/.gitignore index f867868185..7615fe3915 100644 --- a/.gitignore +++ b/.gitignore @@ -81,4 +81,4 @@ win32-build qa/pull-tester/run-bitcoind-for-test.sh qa/pull-tester/build-tests.sh -!src/leveldb-*/Makefile +!src/leveldb*/Makefile diff --git a/configure.ac b/configure.ac index af230c355d..973f4398df 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ define(_CLIENT_VERSION_MINOR, 8) define(_CLIENT_VERSION_REVISION, 99) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, false) -define(_COPYRIGHT_YEAR, 2013) +define(_COPYRIGHT_YEAR, 2014) AC_INIT([Bitcoin],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@bitcoin.org],[bitcoin]) AC_CONFIG_AUX_DIR([src/build-aux]) AC_CONFIG_MACRO_DIR([src/m4]) @@ -24,6 +24,12 @@ m4_include([pkg.m4]) dnl faketime breaks configure and is only needed for make. Disable it here. unset FAKETIME +if test "x${CXXFLAGS+set}" = "xset"; then + CXXFLAGS_overridden=yes +else + CXXFLAGS_overridden=no +fi + dnl ============================================================== dnl Setup for automake dnl ============================================================== @@ -63,38 +69,6 @@ AC_ARG_ENABLE([ipv6], [use_ipv6=$enableval], [use_ipv6=yes]) -dnl enable qt support -AC_ARG_WITH([qt], - [AS_HELP_STRING([--with-qt], - [enable qt (default is yes)])], - [use_qt=$withval], - [use_qt=auto]) -AC_DEFUN([BITCOIN_QT_FAIL],[ - if test "x$use_qt" = "xauto"; then - AC_MSG_WARN([$1; bitcoin-qt frontend will not be built]) - use_qt=no - else - AC_MSG_ERROR([$1]) - fi -]) -AC_DEFUN([BITCOIN_QT_CHECK],[ - if test "x$use_qt" != "xno"; then - true - $1 - else - true - $2 - fi -]) -AC_DEFUN([BITCOIN_QT_PATH_PROGS],[ - BITCOIN_QT_CHECK([ - AC_PATH_PROGS($1,$2,$3,$4) - if test "x$$1" = "x"; then - BITCOIN_QT_FAIL([$1 not found]) - fi - ]) -]) - AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]), [use_tests=$enableval], @@ -116,12 +90,6 @@ AC_ARG_WITH([qrencode], [use_qr=$withval], [use_qr=auto]) -AC_ARG_WITH([qtdbus], - [AS_HELP_STRING([--with-qtdbus], - [enable DBus support (default is yes if qt is enabled and QtDBus is found)])], - [use_dbus=$withval], - [use_dbus=auto]) - AC_ARG_ENABLE([hardening], [AS_HELP_STRING([--enable-hardening], [attempt to harden the resulting executables (default is yes)])], @@ -130,7 +98,7 @@ AC_ARG_ENABLE([hardening], AC_ARG_ENABLE([ccache], [AS_HELP_STRING([--enable-ccache], - [enable building with ccache (default is yes if ccache is found)])], + [use ccache for building (default is yes if ccache is found)])], [use_ccache=$enableval], [use_ccache=auto]) @@ -140,10 +108,6 @@ AC_ARG_ENABLE([lcov], [use_lcov=yes], [use_lcov=no]) -AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], []) -AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], []) -AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-qt-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], []) -AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], []) AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], []) @@ -168,13 +132,7 @@ AC_PATH_PROG(LCOV, lcov) AC_PATH_PROG(JAVA, java) AC_PATH_PROG(GENHTML, genhtml) AC_PATH_PROG([GIT], [git]) -BITCOIN_QT_PATH_PROGS([MOC], [moc-qt4 moc4 moc],, $qt_bin_path:$PATH) -BITCOIN_QT_PATH_PROGS([UIC], [uic-qt4 uic4 uic],, $qt_bin_path:$PATH) -BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt4 rcc4 rcc],, $qt_bin_path:$PATH) -BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt4 lrelease4 lrelease],, $qt_bin_path:$PATH) -BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],, $protoc_bin_path:$PATH) AC_PATH_PROG(CCACHE,ccache) -AC_PATH_PROGS([LUPDATE], [lupdate-qt4 lupdate4 lupdate],, $qt_bin_path:$PATH) AC_PATH_PROG(XGETTEXT,xgettext) AC_PATH_PROG(HEXDUMP,hexdump) PKG_PROG_PKG_CONFIG @@ -182,7 +140,9 @@ PKG_PROG_PKG_CONFIG ## TODO: Remove these hard-coded paths and flags. They are here for the sake of ## compatibility with the legacy buildsystem. ## -CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter" +if test "x$CXXFLAGS_overridden" = "xno"; then + CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter" +fi CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS" AC_LANG_PUSH([C++]) @@ -230,7 +190,9 @@ case $host in CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D__USE_MINGW_ANSI_STDIO" LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE" - CXXFLAGS="$CXXFLAGS -w" + if test "x$CXXFLAGS_overridden" = "xno"; then + CXXFLAGS="$CXXFLAGS -w" + fi ;; *darwin*) TARGET_OS=darwin @@ -239,7 +201,7 @@ case $host in AC_CHECK_PROG([PORT],port, port) if test x$PORT = xport; then dnl add default macports paths - CPPFLAGS="$CPPFLAGS -I/opt/local/include -I/opt/local/include/db48" + CPPFLAGS="$CPPFLAGS -isystem /opt/local/include -I/opt/local/include/db48" LIBS="$LIBS -L/opt/local/lib -L/opt/local/lib/db48" fi @@ -254,17 +216,9 @@ case $host in fi fi - BITCOIN_QT_CHECK([ - MOC_DEFS="-DQ_OS_MAC" - base_frameworks="-framework Foundation -framework ApplicationServices -framework AppKit" - AX_CHECK_LINK_FLAG([[$base_frameworks]],[LIBS="$LIBS $base_frameworks"],[AC_MSG_ERROR(could not find base frameworks)]) - ]) - CPPFLAGS="$CPPFLAGS -DMAC_OSX" - TESTDEFS="-DBOOST_TEST_DYN_LINK" ;; *) - TESTDEFS="-DBOOST_TEST_DYN_LINK" ;; esac @@ -332,7 +286,12 @@ if test x$use_hardening != xno; then AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"]) AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"]) - AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"]) + AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[ + AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[ + HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE" + ]) + HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2" + ]) AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"]) AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"]) @@ -369,6 +328,14 @@ AC_TRY_COMPILE([#include <sys/socket.h>], [ AC_MSG_RESULT(no)] ) +LEVELDB_CPPFLAGS= +LIBLEVELDB= +LIBMEMENV= +AM_CONDITIONAL([EMBEDDED_LEVELDB],[true]) +AC_SUBST(LEVELDB_CPPFLAGS) +AC_SUBST(LIBLEVELDB) +AC_SUBST(LIBMEMENV) + if test x$enable_wallet != xno; then dnl Check for libdb_cxx only if wallet enabled BITCOIN_FIND_BDB48 @@ -399,6 +366,24 @@ if test x$use_tests = xyes; then AX_BOOST_UNIT_TEST_FRAMEWORK + + dnl Determine if -DBOOST_TEST_DYN_LINK is needed + AC_MSG_CHECKING([for dynamic linked boost test]) + TEMP_LIBS="$LIBS" + LIBS="$LIBS $BOOST_UNIT_TEST_FRAMEWORK_LIB" + TEMP_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define BOOST_TEST_DYN_LINK + #define BOOST_TEST_MAIN + #include <boost/test/unit_test.hpp> + + ])], + [AC_MSG_RESULT(yes)] + [TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"], + [AC_MSG_RESULT(no)]) + LIBS="$TEMP_LIBS" + CPPFLAGS="$TEMP_CPPFLAGS" fi BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB" @@ -411,8 +396,13 @@ dnl after 1.56. dnl If neither is available, abort. dnl If sleep_for is used, boost_chrono becomes a requirement. if test x$ax_cv_boost_chrono = xyes; then +dnl Allow passing extra needed dependency libraries for boost-chrono from static gitian build +BOOST_CHRONO_LIB="$BOOST_CHRONO_LIB $BOOST_CHRONO_EXTRALIBS" + TEMP_LIBS="$LIBS" LIBS="$LIBS $BOOST_LIBS $BOOST_CHRONO_LIB" +TEMP_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_TRY_LINK([ #include <boost/thread/thread.hpp> #include <boost/version.hpp> @@ -427,11 +417,14 @@ AC_TRY_LINK([ AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])], [boost_sleep=no]) LIBS="$TEMP_LIBS" +CPPFLAGS="$TEMP_CPPFLAGS" fi if test x$boost_sleep != xyes; then TEMP_LIBS="$LIBS" LIBS="$LIBS $BOOST_LIBS" +TEMP_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_TRY_LINK([ #include <boost/version.hpp> #include <boost/thread.hpp> @@ -446,12 +439,27 @@ AC_TRY_LINK([ [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])], [boost_sleep=no]) LIBS="$TEMP_LIBS" +CPPFLAGS="$TEMP_CPPFLAGS" fi if test x$boost_sleep != xyes; then - AC_MSG_ERROR(No working boost sleep implementation found) + AC_MSG_ERROR(No working boost sleep implementation found. If on ubuntu 13.10 with libboost1.54-all-dev remove libboost.1.54-all-dev and use libboost1.53-all-dev) fi +AC_ARG_WITH([cli], + [AS_HELP_STRING([--with-cli], + [with CLI (default is yes)])], + [build_bitcoin_cli=$withval], + [build_bitcoin_cli=yes]) + +AC_ARG_WITH([daemon], + [AS_HELP_STRING([--with-daemon], + [with daemon (default is yes)])], + [build_bitcoind=$withval], + [build_bitcoind=yes]) + +BITCOIN_QT_INIT + if test x$use_pkgconfig = xyes; then if test x$PKG_CONFIG == x; then @@ -464,23 +472,10 @@ if test x$use_pkgconfig = xyes; then [ PKG_CHECK_MODULES([SSL], [libssl], [INCLUDES="$INCLUDES $SSL_CFLAGS"; LIBS="$LIBS $SSL_LIBS"], [AC_MSG_ERROR(openssl not found.)]) PKG_CHECK_MODULES([CRYPTO], [libcrypto], [INCLUDES="$INCLUDES $CRYPTO_CFLAGS"; LIBS="$LIBS $CRYPTO_LIBS"], [AC_MSG_ERROR(libcrypto not found.)]) - - BITCOIN_QT_CHECK([ - PKG_CHECK_MODULES([QT], [QtCore QtGui QtNetwork], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes],[ - have_qt=no - BITCOIN_QT_FAIL([Qt dependencies not found]) - ]) - if test x$use_tests = xyes; then - PKG_CHECK_MODULES([QT_TEST], [QtTest], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no]) - fi - if test x$use_dbus != xno; then - PKG_CHECK_MODULES([QT_DBUS], [QtDBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no]) - fi - if test x$use_qr != xno; then - PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no]) - fi - PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [AC_MSG_ERROR(libprotobuf not found.)]) - ]) + BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])]) + if test x$use_qr != xno; then + BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])]) + fi ] ) else @@ -490,85 +485,30 @@ else AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),) AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR(libssl missing)) - BITCOIN_QT_CHECK([ - TEMP_LIBS="$LIBS" - LIBS= - if test x$qt_lib_path != x; then - QT_LIBS="$QT_LIBS -L$qt_lib_path" - LIBS="$QT_LIBS" - fi - if test x$qt_plugin_path != x; then - QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs" - LIBS="$QT_LIBS" - fi + BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found))) + if test x$use_qr != xno; then + BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],, [have_qrencode=no])]) + BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)]) + fi +fi - if test x$TARGET_OS == xwindows; then - AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found)) - fi - ]) +BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path) - #TODO: These are only needed when they're linked directly to parent libs. It really has nothing to do with windows. - #Instead, check for missing functions in parent libs and assume static if they're absent. - if test x$TARGET_OS == xwindows; then - BITCOIN_QT_CHECK(AC_CHECK_LIB([qcncodecs],[main],,BITCOIN_QT_FAIL(libqcncodecs not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([qjpcodecs],[main],,BITCOIN_QT_FAIL(libqjpcodecs not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([qkrcodecs],[main],,BITCOIN_QT_FAIL(libqkrcodecs not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([qtwcodecs],[main],,BITCOIN_QT_FAIL(libqtwcodecs not found))) - fi +AC_MSG_CHECKING([whether to build bitcoind]) +AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes]) +AC_MSG_RESULT($build_bitcoind) - BITCOIN_QT_CHECK(AC_CHECK_LIB([QtCore] ,[main],,BITCOIN_QT_FAIL(libQtCore not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([QtGui] ,[main],,BITCOIN_QT_FAIL(libQtGui not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([QtNetwork],[main],,BITCOIN_QT_FAIL(libQtNetwork not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found))) +AC_MSG_CHECKING([whether to build bitcoin-cli]) +AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes]) +AC_MSG_RESULT($build_bitcoin_cli) - BITCOIN_QT_CHECK([ - QT_LIBS="$LIBS" - LIBS="$TEMP_LIBS" +dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus +BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4]) - TEMP_CPPFLAGS="$CPPFLAGS" - 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/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus" - CPPFLAGS="$CPPFLAGS $QT_INCLUDES" - fi - ]) - BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing))]) - BITCOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing))]) - BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))]) - - BITCOIN_QT_CHECK([ - if test x$use_tests = xyes; then - TEMP_LIBS="$LIBS" - LIBS= - if test x$qt_lib_path != x; then - LIBS="-L$qt_lib_path" - fi - AC_CHECK_LIB([QtTest], [main],, have_qt_test=no) - AC_CHECK_HEADER([QTest],, have_qt_test=no) - QT_TEST_LIBS="$LIBS" - LIBS="$TEMP_LIBS" - fi - if test x$use_dbus != xno; then - TEMP_LIBS="$LIBS" - LIBS= - if test x$qt_lib_path != x; then - LIBS="-L$qt_lib_path" - fi - AC_CHECK_LIB([QtDBus], [main],, have_qt_dbus=no) - AC_CHECK_HEADER([QtDBus],, have_qt_dbus=no) - QT_DBUS_LIBS="$LIBS" - LIBS="$TEMP_LIBS" - fi - CPPFLAGS="$TEMP_CPPFLAGS" - if test x$use_qr != xno; then - AC_CHECK_LIB([qrencode], [main],, [have_qrencode=no]) - AC_CHECK_HEADER([qrencode.h],, have_qrencode=no) - fi - ]) -fi if test x$use_ipv6 = xyes; then dnl Check for ipv6 build requirements - AC_MSG_CHECKING(for IPV6 build support) + AC_MSG_CHECKING(for operating system IPv6 support) AC_TRY_LINK([ #if defined(_WINDOWS) #include <winsock2.h> @@ -583,18 +523,17 @@ if test x$use_ipv6 = xyes; then struct sockaddr_in6 addr; #endif int temp = socket(AF_INET6, SOCK_STREAM, 0);], - [AC_MSG_RESULT(yes); have_ipv6=yes; AC_DEFINE(HAVE_IPV6, 1, [Define this symbol if you have ipv6 build support])], + [AC_MSG_RESULT(yes); have_ipv6=yes; AC_DEFINE(HAVE_IPV6, 1, [Define this symbol if you have operating system IPv6 support])], [AC_MSG_RESULT(no)]; have_ipv6=no) fi AC_LANG_POP if test "x$use_ccache" != "xno"; then - AC_MSG_CHECKING(if ccache should be enabled) + AC_MSG_CHECKING(if ccache should be used) if test x$CCACHE = x; then if test "x$use_ccache" = "xyes"; then AC_MSG_ERROR([ccache not found.]); else - AC_MSG_NOTICE([ccache not found. Falling back to default CC]) use_ccache=no fi else @@ -613,39 +552,35 @@ if test x$enable_wallet != xno; then else AC_MSG_RESULT(no) - - if test "x$use_qt" != "xno"; then - AC_MSG_ERROR([Cannot currently build Qt GUI with wallet disabled. Use --without-qt.]) - fi fi dnl enable ipv6 support -AC_MSG_CHECKING([if ipv6 should be enabled]) +AC_MSG_CHECKING([whether to build with support for IPv6]) if test x$have_ipv6 = xno; then if test x$use_ipv6 = xyes; then - AC_MSG_ERROR("ipv6 requested but cannot be built. use --disable-ipv6") + AC_MSG_ERROR([IPv6 requested, but cannot be built. use --disable-ipv6]) fi AC_MSG_RESULT(no) else if test x$use_ipv6 = xyes; then AC_MSG_RESULT(yes) - AC_DEFINE([USE_IPV6],[1],[Define if ipv6 support should be compiled in]) + AC_DEFINE([USE_IPV6],[1],[Define if IPv6 support should be compiled in]) else AC_MSG_RESULT(no) fi fi dnl enable upnp support -AC_MSG_CHECKING([if upnp should be enabled]) +AC_MSG_CHECKING([whether to build with support for UPnP]) if test x$have_miniupnpc = xno; then if test x$use_upnp = xyes; then - AC_MSG_ERROR("upnp requested but cannot be built. use --without-miniupnpc") + AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc") fi AC_MSG_RESULT(no) else if test x$use_upnp != xno; then AC_MSG_RESULT(yes) - AC_MSG_CHECKING([if upnp should be on by default]) + AC_MSG_CHECKING([whether to build with UPnP enabled by default]) use_upnp=yes upnp_setting=0 if test x$use_upnp_default != xno; then @@ -653,7 +588,7 @@ else upnp_setting=1 fi AC_MSG_RESULT($use_upnp_default) - AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[Define to 1 for upnp runtime support]) + AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state]) if test x$TARGET_OS = xwindows; then CPPFLAGS="$CPPFLAGS -DSTATICLIB" fi @@ -662,49 +597,18 @@ else fi fi -dnl enable qt support -AC_MSG_CHECKING([if qt should be enabled]) -BITCOIN_QT_CHECK([ - use_qt=yes - BUILD_QT=qt - if test x$use_tests = xyes; then - if test x$have_qt_test = xno; then - AC_MSG_ERROR("libQtTest not found. Use --disable-tests or --without-qt.") - fi - fi - if test x$have_qt_dbus = xno; then - if test x$use_dbus = xyes; then - AC_MSG_ERROR("libQtDBus not found. Install libQtDBus or remove --with-qtdbus.") - fi - use_dbus=no - fi - if test x$XGETTEXT == x; then - AC_MSG_WARN("xgettext is required to update qt translations") - fi - if test x$LUPDATE == x; then - AC_MSG_WARN("lupdate is required to update qt translations") - fi -],[ - use_qt=no -]) - -AC_MSG_RESULT($use_qt) - dnl these are only used when qt is enabled -if test x$use_qt = xyes; then - +if test x$bitcoin_enable_qt != xno; then + BUILD_QT=qt dnl enable dbus support - AC_MSG_CHECKING([if dbus should be enabled]) - if test x$use_dbus != xno; then - use_dbus=yes + AC_MSG_CHECKING([whether to build GUI with support for D-Bus]) + if test x$bitcoin_enable_qt_dbus != xno; then AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in]) - else - use_dbus=no fi - AC_MSG_RESULT($use_dbus) + AC_MSG_RESULT($bitcoin_enable_qt_dbus) dnl enable qr support - AC_MSG_CHECKING([if qr should be enabled]) + AC_MSG_CHECKING([whether to build GUI with support for QR codes]) if test x$have_qrencode = xno; then if test x$use_qr == xyes; then AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode") @@ -720,13 +624,29 @@ if test x$use_qt = xyes; then fi fi - if test x$use_tests$have_qt_test = xyesyes; then + if test x$XGETTEXT == x; then + AC_MSG_WARN("xgettext is required to update qt translations") + fi + + AC_MSG_CHECKING([whether to build test_bitcoin-qt]) + if test x$use_tests$bitcoin_enable_qt_test = xyesyes; then + AC_MSG_RESULT([yes]) BUILD_TEST_QT="test" + else + AC_MSG_RESULT([no]) fi fi +AC_MSG_CHECKING([whether to build test_bitcoin]) if test x$use_tests = xyes; then + AC_MSG_RESULT([yes]) BUILD_TEST="test" +else + AC_MSG_RESULT([no]) +fi + +if test "x$use_tests$build_bitcoind$use_qt" = "xnonono"; then + AC_MSG_ERROR([No targets! Please specify at least one of: --enable-cli --enable-daemon --enable-gui or --enable-tests]) fi AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) @@ -756,17 +676,10 @@ AC_SUBST(USE_QRCODE) AC_SUBST(USE_IPV6) AC_SUBST(INCLUDES) AC_SUBST(BOOST_LIBS) -AC_SUBST(MOC_DEFS) -AC_SUBST(QT_INCLUDES) -AC_SUBST(QT_TEST_LIBS) -AC_SUBST(QT_LIBS) -AC_SUBST(QT_DBUS_LIBS) -AC_SUBST(QT_DBUS_INCLUDES) -AC_SUBST(QT_TEST_INCLUDES) AC_SUBST(TESTDEFS) AC_SUBST(LEVELDB_TARGET_FLAGS) -AC_SUBST(BUILD_QT) AC_SUBST(BUILD_TEST) +AC_SUBST(BUILD_QT) AC_SUBST(BUILD_TEST_QT) AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile src/qt/Makefile src/qt/test/Makefile share/setup.nsi share/qt/Info.plist]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) diff --git a/contrib/bitcoin-qt.pro b/contrib/bitcoin-qt.pro index 6e31c2ed81..3a72d10f47 100644 --- a/contrib/bitcoin-qt.pro +++ b/contrib/bitcoin-qt.pro @@ -1,19 +1,21 @@ FORMS += \ - ../src/qt/forms/transactiondescdialog.ui \ - ../src/qt/forms/signverifymessagedialog.ui \ - ../src/qt/forms/sendcoinsentry.ui \ - ../src/qt/forms/sendcoinsdialog.ui \ - ../src/qt/forms/rpcconsole.ui \ - ../src/qt/forms/overviewpage.ui \ - ../src/qt/forms/optionsdialog.ui \ - ../src/qt/forms/intro.ui \ - ../src/qt/forms/editaddressdialog.ui \ - ../src/qt/forms/askpassphrasedialog.ui \ - ../src/qt/forms/addressbookpage.ui \ ../src/qt/forms/aboutdialog.ui \ + ../src/qt/forms/addressbookpage.ui \ + ../src/qt/forms/askpassphrasedialog.ui \ + ../src/qt/forms/coincontroldialog.ui \ + ../src/qt/forms/editaddressdialog.ui \ + ../src/qt/forms/helpmessagedialog.ui \ + ../src/qt/forms/intro.ui \ + ../src/qt/forms/openuridialog.ui \ + ../src/qt/forms/optionsdialog.ui \ + ../src/qt/forms/overviewpage.ui \ ../src/qt/forms/receivecoinsdialog.ui \ ../src/qt/forms/receiverequestdialog.ui \ - ../src/qt/forms/openuridialog.ui + ../src/qt/forms/rpcconsole.ui \ + ../src/qt/forms/sendcoinsdialog.ui \ + ../src/qt/forms/sendcoinsentry.ui \ + ../src/qt/forms/signverifymessagedialog.ui \ + ../src/qt/forms/transactiondescdialog.ui \ RESOURCES += \ ../src/qt/bitcoin.qrc diff --git a/contrib/debian/copyright b/contrib/debian/copyright index b99604913c..a6ee201991 100644 --- a/contrib/debian/copyright +++ b/contrib/debian/copyright @@ -6,9 +6,9 @@ Source: http://sourceforge.net/projects/bitcoin/files/ https://github.com/bitcoin/bitcoin Files: * -Copyright: 2009-2012, Bitcoin Developers +Copyright: 2009-2012, Bitcoin Core Developers License: Expat -Comment: The Bitcoin Developers encompasses the current developers listed on bitcoin.org, +Comment: The Bitcoin Core Developers encompasses the current developers listed on bitcoin.org, as well as the numerous contributors to the project. Files: src/json/* @@ -71,7 +71,7 @@ Copyright: Bitboy (optimized for 16x16 by Wladimir van der Laan) License: PUB-DOM Comment: Site: https://bitcointalk.org/?topic=1756.0 -Files: scripts/img/reload.xcf, src/qt/res/movies/update_spinner.mng +Files: scripts/img/reload.xcf, src/qt/res/movies/*.png Copyright: Everaldo (Everaldo Coelho) License: GPL-3+ Comment: Icon Pack: Kids diff --git a/contrib/gitian-descriptors/README.md b/contrib/gitian-descriptors/README.md index 40bdbd8e32..3a90b4d038 100644 --- a/contrib/gitian-descriptors/README.md +++ b/contrib/gitian-descriptors/README.md @@ -25,18 +25,8 @@ Once you've got the right hardware and software: mkdir gitian-builder/inputs cd gitian-builder/inputs - # Inputs for Linux and Win32: - wget -O miniupnpc-1.6.tar.gz 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.tar.gz' - wget 'http://fukuchi.org/works/qrencode/qrencode-3.2.0.tar.bz2' - - # Inputs for Win32: (Linux has packages for these) - wget 'https://downloads.sourceforge.net/project/boost/boost/1.50.0/boost_1_50_0.tar.bz2' - wget 'http://www.openssl.org/source/openssl-1.0.1c.tar.gz' - wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' - wget 'https://downloads.sourceforge.net/project/libpng/zlib/1.2.6/zlib-1.2.6.tar.gz' - wget 'https://downloads.sourceforge.net/project/libpng/libpng15/older-releases/1.5.9/libpng-1.5.9.tar.gz' - wget 'https://download.qt-project.org/archive/qt/4.8/4.8.3/qt-everywhere-opensource-src-4.8.3.tar.gz' - wget 'http://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2' + # Get inputs (see doc/release-process.md for exact inputs needed and where to get them) + ... cd ../.. cd gitian-builder @@ -49,7 +39,7 @@ Once you've got the right hardware and software: git pull cd ../gitian-builder git pull - ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/gitian.yml + ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml # Build Win32 dependencies: (only needs to be done once, or when dependency versions change) ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian-descriptors/boost-win32.yml @@ -87,4 +77,4 @@ Here's a description of Gavin's setup on OSX 10.6: export USE_LXC=1 git clone git://github.com/bitcoin/bitcoin.git - ... etc
\ No newline at end of file + ... etc diff --git a/contrib/gitian-descriptors/boost-linux.yml b/contrib/gitian-descriptors/boost-linux.yml new file mode 100644 index 0000000000..5d22294dd8 --- /dev/null +++ b/contrib/gitian-descriptors/boost-linux.yml @@ -0,0 +1,42 @@ +--- +name: "boost" +suites: +- "precise" +architectures: +- "i386" +- "amd64" +packages: +- "unzip" +- "pkg-config" +- "libtool" +- "faketime" +- "bsdmainutils" +- "zip" +reference_datetime: "2011-01-30 00:00:00" +remotes: [] +files: +- "boost_1_55_0.tar.bz2" +script: | + STAGING="$HOME/install" + export LIBRARY_PATH="$STAGING/lib" + # Input Integrity Check + echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c + + mkdir -p "$STAGING" + tar xjf boost_1_55_0.tar.bz2 + cd boost_1_55_0 + GCCVERSION=$(g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) + # note: bjam with -d+2 reveals that -O3 is implied by default, no need to provide it in cxxflags + echo "using gcc : $GCCVERSION : g++ + : + <cxxflags>\"-frandom-seed=boost1 -fPIC\" + ;" > user-config.jam + + ./bootstrap.sh --without-icu + + ./bjam toolset=gcc threadapi=pthread threading=multi variant=release link=static runtime-link=shared --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 --layout=tagged --build-type=complete --prefix="$STAGING" $MAKEOPTS install + + cd "$STAGING" + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + zip -r $OUTDIR/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip * diff --git a/contrib/gitian-descriptors/boost-win32.yml b/contrib/gitian-descriptors/boost-win32.yml index b421cbe8c5..55e74ce3e1 100644 --- a/contrib/gitian-descriptors/boost-win32.yml +++ b/contrib/gitian-descriptors/boost-win32.yml @@ -12,19 +12,19 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "boost_1_54_0.tar.bz2" +- "boost_1_55_0.tar.bz2" - "boost-mingw-gas-cross-compile-2013-03-03.patch" script: | # Defines - INSTALLPREFIX="$OUTDIR/staging/boost" + INSTALLPREFIX="$HOME/install" HOST=i686-w64-mingw32 # Input Integrity Check - echo "047e927de336af106a24bceba30069980c191529fd76b8dff8eb9a328b48ae1d boost_1_54_0.tar.bz2" | shasum -c + echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c echo "d2b7f6a1d7051faef3c9cf41a92fa3671d905ef1e1da920d07651a43299f6268 boost-mingw-gas-cross-compile-2013-03-03.patch" | shasum -c mkdir -p "$INSTALLPREFIX" - tar xjf boost_1_54_0.tar.bz2 - cd boost_1_54_0 + tar xjf boost_1_55_0.tar.bz2 + cd boost_1_55_0 GCCVERSION=$($HOST-g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) echo "using gcc : $GCCVERSION : $HOST-g++ : @@ -48,7 +48,7 @@ script: | # Patch Mirror: http://rose.makesad.us/~paulproteus/mirrors/boost-mingw-gas-cross-compile-2013-03-03.patch patch -p0 < ../boost-mingw-gas-cross-compile-2013-03-03.patch - # Bug Workaround: boost-1.54.0 broke the ability to disable zlib + # Bug Workaround: boost-1.54.0 broke the ability to disable zlib, still broken in 1.55 # https://svn.boost.org/trac/boost/ticket/9156 sed -i 's^\[ ac.check-library /zlib//zlib : <library>/zlib//zlib^^' libs/iostreams/build/Jamfile.v2 sed -i 's^<source>zlib.cpp <source>gzip.cpp \]^^' libs/iostreams/build/Jamfile.v2 @@ -57,10 +57,9 @@ script: | # Note: Might need these options in the future for 64bit builds. # "Please note that address-model=64 must be given to bjam command line on 64bit Windows for 64bit build; otherwise 32bit code will be generated." # "For cross-compiling the lib you must specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model." - ./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install + ./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 threading=multi variant=release link=static runtime-link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install cd "$INSTALLPREFIX" export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME - zip -r boost-win32-1.54.0-gitian-r6.zip * - cp boost-win32-1.54.0-gitian-r6.zip $OUTDIR + zip -r $OUTDIR/boost-win32-1.55.0-gitian-r6.zip * diff --git a/contrib/gitian-descriptors/deps-linux.yml b/contrib/gitian-descriptors/deps-linux.yml new file mode 100644 index 0000000000..41d8d65fb7 --- /dev/null +++ b/contrib/gitian-descriptors/deps-linux.yml @@ -0,0 +1,74 @@ +--- +name: "bitcoin" +suites: +- "precise" +architectures: +- "i386" +- "amd64" +packages: +- "unzip" +- "zip" +- "pkg-config" +- "libtool" +- "faketime" +- "bsdmainutils" +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "openssl-1.0.1e.tar.gz" +- "miniupnpc-1.8.tar.gz" +- "qrencode-3.4.3.tar.bz2" +- "protobuf-2.5.0.tar.bz2" +- "db-4.8.30.NC.tar.gz" +script: | + STAGING="$HOME/install" + OPTFLAGS='-O2' + export LIBRARY_PATH="$STAGING/lib" + # Integrity Check + echo "f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3 openssl-1.0.1e.tar.gz" | sha256sum -c + echo "bc5f73c7b0056252c1888a80e6075787a1e1e9112b808f863a245483ff79859c miniupnpc-1.8.tar.gz" | sha256sum -c + echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c + echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c + echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c + + # + tar xzf openssl-1.0.1e.tar.gz + cd openssl-1.0.1e + # need -fPIC to avoid relocation error in 64 bit builds + ./config no-shared no-zlib no-dso no-krb5 --openssldir=$STAGING -fPIC + make + make install_sw + cd .. + # + tar xzfm miniupnpc-1.8.tar.gz + cd miniupnpc-1.8 + # miniupnpc is always built with -fPIC + INSTALLPREFIX=$STAGING make $MAKEOPTS install + rm -f $STAGING/lib/libminiupnpc.so* # no way to skip shared lib build + cd .. + # + tar xjfm qrencode-3.4.3.tar.bz2 + cd qrencode-3.4.3 + # need --with-pic to avoid relocation error in 64 bit builds + ./configure --prefix=$STAGING --enable-static --disable-shared -with-pic --without-tools + make $MAKEOPTS install + cd .. + # + tar xjfm protobuf-2.5.0.tar.bz2 + cd protobuf-2.5.0 + mkdir -p $STAGING/host/bin + # need --with-pic to avoid relocation error in 64 bit builds + ./configure --prefix=$STAGING --bindir=$STAGING/host/bin --enable-static --disable-shared --with-pic + make $MAKEOPTS install + cd .. + # + tar xzf db-4.8.30.NC.tar.gz + cd db-4.8.30.NC/build_unix + # need --with-pic to avoid relocation error in 64 bit builds + ../dist/configure --prefix=$STAGING --enable-cxx --disable-shared --with-pic + make $MAKEOPTS library_build + make install_lib install_include + cd ../.. + # + cd $STAGING + zip -r $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r2.zip include lib bin host diff --git a/contrib/gitian-descriptors/deps-win32.yml b/contrib/gitian-descriptors/deps-win32.yml index addb11d726..12b9dfc70c 100644 --- a/contrib/gitian-descriptors/deps-win32.yml +++ b/contrib/gitian-descriptors/deps-win32.yml @@ -14,12 +14,12 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "openssl-1.0.1c.tar.gz" +- "openssl-1.0.1e.tar.gz" - "db-4.8.30.NC.tar.gz" -- "miniupnpc-1.6.tar.gz" -- "zlib-1.2.6.tar.gz" -- "libpng-1.5.9.tar.gz" -- "qrencode-3.2.0.tar.bz2" +- "miniupnpc-1.8.tar.gz" +- "zlib-1.2.8.tar.gz" +- "libpng-1.6.8.tar.gz" +- "qrencode-3.4.3.tar.bz2" script: | # export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 @@ -28,17 +28,17 @@ script: | export INSTALLPREFIX=$OUTDIR/staging/deps export HOST=i686-w64-mingw32 # Input Integrity Check - echo "2a9eb3cd4e8b114eb9179c0d3884d61658e7d8e8bf4984798a5f5bd48e325ebe openssl-1.0.1c.tar.gz" | sha256sum -c + echo "f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3 openssl-1.0.1e.tar.gz" | sha256sum -c echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c - echo "bbd6b756e6af44b5a5b0f9b93eada3fb8922ed1d6451b7d6f184d0ae0c813994 miniupnpc-1.6.tar.gz" | sha256sum -c - echo "21235e08552e6feba09ea5e8d750805b3391c62fb81c71a235c0044dc7a8a61b zlib-1.2.6.tar.gz" | sha256sum -c - echo "b75dae26151f9b031062c8d2f577a094b08da0ae44fe8c11175d0b9ff434cc02 libpng-1.5.9.tar.gz" | sha256sum -c - echo "03c4bc7cd9a75747c3815d509bbe061907d615764f2357923f0db948c567068f qrencode-3.2.0.tar.bz2" | sha256sum -c + echo "bc5f73c7b0056252c1888a80e6075787a1e1e9112b808f863a245483ff79859c miniupnpc-1.8.tar.gz" | sha256sum -c + echo "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d zlib-1.2.8.tar.gz" | sha256sum -c + echo "32c7acf1608b9c8b71b743b9780adb7a7b347563dbfb4a5263761056da44cc96 libpng-1.6.8.tar.gz" | sha256sum -c + echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c mkdir -p $INSTALLPREFIX - tar xzf openssl-1.0.1c.tar.gz - cd openssl-1.0.1c + tar xzf openssl-1.0.1e.tar.gz + cd openssl-1.0.1e ./Configure --cross-compile-prefix=$HOST- mingw --openssldir=$INSTALLPREFIX make make install_sw @@ -51,11 +51,11 @@ script: | make install_lib install_include cd ../.. # - tar xzf miniupnpc-1.6.tar.gz - cd miniupnpc-1.6 + tar xzf miniupnpc-1.8.tar.gz + cd miniupnpc-1.8 echo " - --- miniupnpc-1.6/Makefile.mingw.orig 2013-09-29 18:52:51.014087958 -1000 - +++ miniupnpc-1.6/Makefile.mingw 2013-09-29 19:09:29.663318691 -1000 + --- miniupnpc-1.8/Makefile.mingw.orig 2013-09-29 18:52:51.014087958 -1000 + +++ miniupnpc-1.8/Makefile.mingw 2013-09-29 19:09:29.663318691 -1000 @@ -67,8 +67,8 @@ wingenminiupnpcstrings.o: wingenminiupnpcstrings.c @@ -75,26 +75,27 @@ script: | install libminiupnpc.a $INSTALLPREFIX/lib cd .. # - tar xzf zlib-1.2.6.tar.gz - cd zlib-1.2.6 + tar xzf zlib-1.2.8.tar.gz + cd zlib-1.2.8 CROSS_PREFIX=$HOST- ./configure --prefix=$INSTALLPREFIX --static make make install cd .. # - tar xzf libpng-1.5.9.tar.gz - cd libpng-1.5.9 - CFLAGS="-I$INSTALLPREFIX/include" LDFLAGS="-L$INSTALLPREFIX/lib" ./configure --disable-shared --prefix=$INSTALLPREFIX --host=$HOST + tar xzf libpng-1.6.8.tar.gz + cd libpng-1.6.8 + OPT="-O2" + CPPFLAGS="${OPT} -I$INSTALLPREFIX/include" CFLAGS="${OPT} -I$INSTALLPREFIX/include" LDFLAGS="${OPT} -L$INSTALLPREFIX/lib" ./configure --disable-shared --prefix=$INSTALLPREFIX --host=$HOST make $MAKEOPTS make install cd .. # - tar xjf qrencode-3.2.0.tar.bz2 - cd qrencode-3.2.0 + tar xjf qrencode-3.4.3.tar.bz2 + cd qrencode-3.4.3 png_CFLAGS="-I$INSTALLPREFIX/include" png_LIBS="-L$INSTALLPREFIX/lib -lpng" ./configure --prefix=$INSTALLPREFIX --host=$HOST make make install cd .. # cd $INSTALLPREFIX - zip -r $OUTDIR/bitcoin-deps-win32-gitian-r9.zip include lib + zip -r $OUTDIR/bitcoin-deps-win32-gitian-r10.zip include lib diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml new file mode 100644 index 0000000000..417f31e270 --- /dev/null +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -0,0 +1,52 @@ +--- +name: "bitcoin" +suites: +- "precise" +architectures: +- "i386" +- "amd64" +packages: +- "libqt4-dev" +- "git-core" +- "unzip" +- "pkg-config" +- "autoconf2.13" +- "libtool" +- "automake" +- "faketime" +- "bsdmainutils" +reference_datetime: "2013-06-01 00:00:00" +remotes: +- "url": "https://github.com/bitcoin/bitcoin.git" + "dir": "bitcoin" +files: +- "bitcoin-deps-linux32-gitian-r2.zip" +- "bitcoin-deps-linux64-gitian-r2.zip" +- "boost-linux32-1.55.0-gitian-r1.zip" +- "boost-linux64-1.55.0-gitian-r1.zip" +script: | + STAGING="$HOME/install" + OPTFLAGS='-O2' + BINDIR="${OUTDIR}/bin/${GBUILD_BITS}" # 32/64 bit build specific output directory + export LIBRARY_PATH="$STAGING/lib" + mkdir -p ${BINDIR} + # + mkdir -p $STAGING + cd $STAGING + unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r2.zip + unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip + cd ../build + # + cd bitcoin + export TAR_OPTIONS=--mtime=`echo $REFERENCE_DATETIME | awk '{ print $1 }'` + ./autogen.sh + ./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" + make dist + mkdir -p distsrc + cd distsrc + tar --strip-components=1 -xf ../bitcoin-*.tar.* + ./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" + make $MAKEOPTS + make $MAKEOPTS install-strip + mkdir -p $OUTDIR/src + cp ../bitcoin-*.tar.* $OUTDIR/src diff --git a/contrib/gitian-descriptors/gitian-win32.yml b/contrib/gitian-descriptors/gitian-win32.yml index a8a823cac0..eac74272c5 100644 --- a/contrib/gitian-descriptors/gitian-win32.yml +++ b/contrib/gitian-descriptors/gitian-win32.yml @@ -22,33 +22,34 @@ remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "qt-win32-4.8.3-gitian-r4.zip" -- "boost-win32-1.54.0-gitian-r6.zip" -- "bitcoin-deps-win32-gitian-r9.zip" -- "protobuf-win32-2.5.0-gitian-r3.zip" +- "qt-win32-5.2.0-gitian-r1.zip" +- "boost-win32-1.55.0-gitian-r6.zip" +- "bitcoin-deps-win32-gitian-r10.zip" +- "protobuf-win32-2.5.0-gitian-r4.zip" script: | # STAGING=$HOME/staging HOST=i686-w64-mingw32 + OPTFLAGS='-O2' # mkdir -p $STAGING cd $STAGING - unzip ../build/qt-win32-4.8.3-gitian-r4.zip - unzip ../build/boost-win32-1.54.0-gitian-r6.zip - unzip ../build/bitcoin-deps-win32-gitian-r9.zip - unzip ../build/protobuf-win32-2.5.0-gitian-r3.zip + unzip ../build/qt-win32-5.2.0-gitian-r1.zip + unzip ../build/boost-win32-1.55.0-gitian-r6.zip + unzip ../build/bitcoin-deps-win32-gitian-r10.zip + unzip ../build/protobuf-win32-2.5.0-gitian-r4.zip cd $HOME/build/ # cd bitcoin export PATH=$STAGING/host/bin:$PATH export TAR_OPTIONS=--mtime=`echo $REFERENCE_DATETIME | awk '{ print $1 }'` ./autogen.sh - ./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include" LDFLAGS="-L$STAGING/lib" CXXFLAGS="-frandom-seed=bitcoin" + ./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" make dist mkdir -p distsrc cd distsrc tar --strip-components=1 -xf ../bitcoin-*.tar.* - ./configure --bindir=$OUTDIR --prefix=$STAGING --host=i686-w64-mingw32 --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include" LDFLAGS="-L$STAGING/lib" CXXFLAGS="-frandom-seed=bitcoin" + ./configure --bindir=$OUTDIR --prefix=$STAGING --host=i686-w64-mingw32 --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC diff --git a/contrib/gitian-descriptors/gitian.yml b/contrib/gitian-descriptors/gitian.yml deleted file mode 100644 index e29033d29b..0000000000 --- a/contrib/gitian-descriptors/gitian.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -name: "bitcoin" -suites: -- "lucid" -architectures: -- "i386" -- "amd64" -packages: -- "libdb4.8++-dev" -- "qt4-qmake" -- "libqt4-dev" -- "libboost-system-dev" -- "libboost-filesystem-dev" -- "libboost-program-options-dev" -- "libboost-thread-dev" -- "libboost-test-dev" -- "libssl-dev" -- "git-core" -- "unzip" -- "pkg-config" -- "libpng12-dev" -- "autoconf2.13" -- "libtool" -- "automake" -- "faketime" -- "bsdmainutils" -reference_datetime: "2013-06-01 00:00:00" -remotes: -- "url": "https://github.com/bitcoin/bitcoin.git" - "dir": "bitcoin" -files: -- "miniupnpc-1.6.tar.gz" -- "qrencode-3.2.0.tar.bz2" -- "protobuf-2.5.0.tar.bz2" -script: | - STAGING="$HOME/install" - export LIBRARY_PATH="$STAGING/lib" - # Integrity Check - echo "bbd6b756e6af44b5a5b0f9b93eada3fb8922ed1d6451b7d6f184d0ae0c813994 miniupnpc-1.6.tar.gz" | sha256sum -c - echo "03c4bc7cd9a75747c3815d509bbe061907d615764f2357923f0db948c567068f qrencode-3.2.0.tar.bz2" | sha256sum -c - echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c - - tar xzfm miniupnpc-1.6.tar.gz - cd miniupnpc-1.6 - INSTALLPREFIX=$STAGING make $MAKEOPTS install - cd .. - # - tar xjfm qrencode-3.2.0.tar.bz2 - cd qrencode-3.2.0 - sed -i 's/@LIBPTHREAD@//' libqrencode.pc.in - ./configure --prefix=$STAGING --enable-static --disable-shared - make $MAKEOPTS install - cd .. - # - tar xjfm protobuf-2.5.0.tar.bz2 - cd protobuf-2.5.0 - mkdir -p $STAGING/host/bin - ./configure --prefix=$STAGING --bindir=$STAGING/host/bin --enable-static --disable-shared - make $MAKEOPTS install - cd .. - # - cd bitcoin - export TAR_OPTIONS=--mtime=`echo $REFERENCE_DATETIME | awk '{ print $1 }'` - ./autogen.sh - ./configure --prefix=$STAGING --bindir=$OUTDIR --with-protoc-bindir=$STAGING/host/bin --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include" LDFLAGS="-L$STAGING/lib" CXXFLAGS="-frandom-seed=bitcoin" - make dist - mkdir -p distsrc - cd distsrc - tar --strip-components=1 -xf ../bitcoin-*.tar.* - ./configure --prefix=$STAGING --bindir=$OUTDIR --with-protoc-bindir=$STAGING/host/bin --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include" LDFLAGS="-L$STAGING/lib" CXXFLAGS="-frandom-seed=bitcoin" - make $MAKEOPTS - make $MAKEOPTS install-strip - mkdir -p $OUTDIR/src - cp ../bitcoin-*.tar.* $OUTDIR/src diff --git a/contrib/gitian-descriptors/protobuf-win32.yml b/contrib/gitian-descriptors/protobuf-win32.yml index b2e3d0b465..e93f92bbfe 100644 --- a/contrib/gitian-descriptors/protobuf-win32.yml +++ b/contrib/gitian-descriptors/protobuf-win32.yml @@ -18,6 +18,7 @@ script: | export TZ=UTC export INSTALLPREFIX=$OUTDIR/staging/deps export HOST=i686-w64-mingw32 + OPTFLAGS="-O2" # Integrity Check echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c @@ -33,12 +34,12 @@ script: | cp src/protoc $INSTALLPREFIX/host/bin # Now recompile with the mingw cross-compiler: make distclean - ./configure --prefix=$INSTALLPREFIX --enable-shared=no --disable-dependency-tracking --with-protoc=$INSTALLPREFIX/host/bin/protoc --host=$HOST CXXFLAGS=-frandom-seed=11 + ./configure --prefix=$INSTALLPREFIX --enable-shared=no --disable-dependency-tracking --with-protoc=$INSTALLPREFIX/host/bin/protoc --host=$HOST CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}" make make install cd $INSTALLPREFIX export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME - zip -r $OUTDIR/protobuf-win32-2.5.0-gitian-r3.zip include lib host + zip -r $OUTDIR/protobuf-win32-2.5.0-gitian-r4.zip include lib host unset LD_PRELOAD unset FAKETIME diff --git a/contrib/gitian-descriptors/qt-win32.yml b/contrib/gitian-descriptors/qt-win32.yml index ffa8bcab46..8bc53bbf25 100644 --- a/contrib/gitian-descriptors/qt-win32.yml +++ b/contrib/gitian-descriptors/qt-win32.yml @@ -10,41 +10,38 @@ packages: - "zip" - "unzip" - "faketime" -- "unzip" +- "libz-dev" reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "qt-everywhere-opensource-src-4.8.3.tar.gz" -- "bitcoin-deps-win32-gitian-r9.zip" +- "qt-everywhere-opensource-src-5.2.0.tar.gz" +- "bitcoin-deps-win32-gitian-r10.zip" script: | # HOST=i686-w64-mingw32 INSTDIR="$HOME/qt/" # Integrity Check - echo "f1f72974f924861be04019f49f07cd43ab3c95056db2ba8f34b283487cccc728 qt-everywhere-opensource-src-4.8.3.tar.gz" | sha256sum -c + echo "395ec72277c5786c65b8163ef5817fd03d0a1f524a6d47f53624baf8056f1081 qt-everywhere-opensource-src-5.2.0.tar.gz" | sha256sum -c mkdir $INSTDIR mkdir -p $INSTDIR/host/bin # # Need mingw-compiled openssl from bitcoin-deps: - unzip bitcoin-deps-win32-gitian-r9.zip + unzip bitcoin-deps-win32-gitian-r10.zip DEPSDIR=`pwd` # - tar xzf qt-everywhere-opensource-src-4.8.3.tar.gz - cd qt-everywhere-opensource-src-4.8.3 + tar xzf qt-everywhere-opensource-src-5.2.0.tar.gz + cd qt-everywhere-opensource-src-5.2.0 + SPECNAME="win32-g++" + SPECFILE="qtbase/mkspecs/${SPECNAME}/qmake.conf" sed 's/$TODAY/2011-01-30/' -i configure - sed "s/i686-pc-mingw32-/$HOST-/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed --posix "s|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/$HOST/include/ -frandom-seed=qtbuild|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed 's/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed 's/QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads/QMAKE_LFLAGS_EXCEPTIONS_ON = -lmingwthrd/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed --posix "s/QMAKE_MOC\t\t= $HOST-moc/QMAKE_MOC\t\t= moc/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed --posix "s/QMAKE_RCC\t\t= $HOST-rcc/QMAKE_RCC\t\t= rcc/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed --posix "s/QMAKE_UIC\t\t= $HOST-uic/QMAKE_UIC\t\t= uic/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf + sed --posix "s|QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport|QMAKE_CFLAGS\t\t= -pipe -fno-keep-inline-dllexport -isystem /usr/$HOST/include/ -frandom-seed=qtbuild -I$DEPSDIR/include|" -i ${SPECFILE} + sed --posix "s|QMAKE_LFLAGS =|QMAKE_LFLAGS\t\t= -L$DEPSDIR/lib|" -i ${SPECFILE} # ar adds timestamps to every object file included in the static library # providing -D as ar argument is supposed to solve it, but doesn't work as qmake strips off the arguments and adds -M to pass a script... # which somehow cannot be combined with other flags. # use faketime only for ar, as it confuses make/qmake into hanging sometimes - sed --posix "s|QMAKE_LIB\t\t= $HOST-ar -ru|QMAKE_LIB\t\t= $HOME/ar -Dr|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf + sed --posix "s|QMAKE_LIB = \\\$\\\${CROSS_COMPILE}ar -ru|QMAKE_LIB\t\t= $HOME/ar -Dr|" -i ${SPECFILE} echo '#!/bin/bash' > $HOME/ar echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar echo "$HOST-ar \"\$@\"" >> $HOME/ar @@ -52,14 +49,12 @@ script: | #export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC + # # Compile static libraries, and use statically linked openssl (-openssl-linked): - OPENSSL_LIBS="-L$DEPSDIR/lib -lssl -lcrypto -lgdi32" ./configure -prefix $INSTDIR -bindir $INSTDIR/host/bin -I $DEPSDIR/include -confirm-license -release -opensource -static -no-qt3support -xplatform unsupported/win32-g++-cross -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs -no-feature-style-plastique -no-feature-style-cleanlooks -no-feature-style-motif -no-feature-style-cde -no-feature-style-windowsce -no-feature-style-windowsmobile -no-feature-style-s60 -openssl-linked - find . -name *.prl | xargs -l sed 's|/\.||' -i - find . -name *.prl | xargs -l sed 's|/$||' -i + OPENSSL_LIBS="-L$DEPSDIR/lib -lssl -lcrypto -lgdi32" ./configure -prefix $INSTDIR -bindir $INSTDIR/host/bin -confirm-license -release -opensource -static -xplatform $SPECNAME -device-option CROSS_COMPILE="$HOST-" -no-audio-backend -no-javascript-jit -no-sql-sqlite -no-sql-odbc -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-opengl -no-compile-examples -no-feature-style-windowsce -no-feature-style-windowsmobile -no-qml-debug -openssl-linked -skip qtsvg -skip qtwebkit -skip qtwebkit-examples -skip qtserialport -skip qtdeclarative -skip qtmultimedia -skip qtimageformats -skip qtlocation -skip qtsensors -skip qtquick1 -skip qtquickcontrols -skip qtactiveqt -skip qtconnectivity -skip qtwinextras -skip qtxmlpatterns -skip qtscript -skip qtdoc -system-libpng -system-zlib make $MAKEOPTS install cd $INSTDIR - find . -name *.prl | xargs -l sed 's|/$||' -i # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - zip -r $OUTDIR/qt-win32-4.8.3-gitian-r4.zip * + zip -r $OUTDIR/qt-win32-5.2.0-gitian-r1.zip * diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg index 9e5aa404c2..65bba712a5 100644 --- a/contrib/linearize/example-linearize.cfg +++ b/contrib/linearize/example-linearize.cfg @@ -7,6 +7,6 @@ port=8332 # bootstrap.dat settings netmagic=f9beb4d9 -max_height=250000 +max_height=279000 output=bootstrap.dat diff --git a/contrib/linearize/linearize.py b/contrib/linearize/linearize.py index 2d8509f83c..ea3814ab72 100644 --- a/contrib/linearize/linearize.py +++ b/contrib/linearize/linearize.py @@ -73,9 +73,9 @@ def get_blocks(settings): rpc = BitcoinRPC(settings['host'], settings['port'], settings['rpcuser'], settings['rpcpass']) - outf = open(settings['output'], 'wb') + outf = open(settings['output'], 'ab') - for height in xrange(settings['max_height']+1): + for height in xrange(settings['min_height'], settings['max_height']+1): data = getblock(rpc, settings, height) outhdr = settings['netmagic'] @@ -114,14 +114,17 @@ if __name__ == '__main__': settings['host'] = '127.0.0.1' if 'port' not in settings: settings['port'] = 8332 + if 'min_height' not in settings: + settings['min_height'] = 0 if 'max_height' not in settings: - settings['max_height'] = 250000 + settings['max_height'] = 279000 if 'rpcuser' not in settings or 'rpcpass' not in settings: print "Missing username and/or password in cfg file" sys.exit(1) settings['netmagic'] = settings['netmagic'].decode('hex') settings['port'] = int(settings['port']) + settings['min_height'] = int(settings['min_height']) settings['max_height'] = int(settings['max_height']) get_blocks(settings) diff --git a/doc/assets-attribution.md b/doc/assets-attribution.md index e85e74522d..d42be8fb24 100644 --- a/doc/assets-attribution.md +++ b/doc/assets-attribution.md @@ -4,29 +4,29 @@ The following is a list of assets used in the bitcoin source and their proper at ----------------------- #### Info * License: MIT -### Assets Used - src/qt/res/icons/clock*.png, src/qt/res/icons/tx*.png, - src/qt/res/src/clock_green.svg, src/qt/res/src/clock1.svg, - src/qt/res/src/clock2.svg, src/qt/res/src/clock3.svg, - src/qt/res/src/clock4.svg, src/qt/res/src/clock5.svg, - src/qt/res/src/inout.svg, src/qt/res/src/questionmark.svg +### Assets Used + src/qt/res/icons/clock*.png, src/qt/res/icons/tx*.png, + src/qt/res/src/clock_green.svg, src/qt/res/src/clock1.svg, + src/qt/res/src/clock2.svg, src/qt/res/src/clock3.svg, + src/qt/res/src/clock4.svg, src/qt/res/src/clock5.svg, + src/qt/res/src/inout.svg, src/qt/res/src/questionmark.svg -[David Vignoni](www.icon-king.com) +[David Vignoni](http://www.icon-king.com) ----------------------- ### Info * Icon Pack: NUVOLA ICON THEME for KDE 3.x * Designer: David Vignoni (david@icon-king.com) * License: LGPL -* Site: [http://www.icon-king.com/projects/nuvola/](http://www.icon-king.com/projects/nuvola/) +* Site: [http://www.icon-king.com/projects/nuvola](http://www.icon-king.com/projects/nuvola) ### Assets Used - src/qt/res/icons/address-book.png, src/qt/res/icons/export.png, - src/qt/res/icons/history.png, src/qt/res/icons/key.png, - src/qt/res/icons/lock_*.png, src/qt/res/icons/overview.png, - src/qt/res/icons/receive.png, src/qt/res/icons/send.png, - src/qt/res/icons/synced.png, src/qt/res/icons/filesave.png + src/qt/res/icons/address-book.png, src/qt/res/icons/export.png, + src/qt/res/icons/history.png, src/qt/res/icons/key.png, + src/qt/res/icons/lock_*.png, src/qt/res/icons/overview.png, + src/qt/res/icons/receive.png, src/qt/res/icons/send.png, + src/qt/res/icons/synced.png, src/qt/res/icons/filesave.png schollidesign ----------------------- @@ -38,17 +38,16 @@ schollidesign * Site: [http://findicons.com/icon/93743/blocks_gnome_netstatus_0](http://findicons.com/icon/93743/blocks_gnome_netstatus_0) ### Assets Used - src/qt/res/icons/connect*.png + src/qt/res/icons/connect*.png md2k7 ----------------------- ### Info * Designer: md2k7 -* Site: https://bitcointalk.org/index.php?topic=15276.0 -* License: You are free to do with these icons as you wish, including selling, - copying, modifying etc. +* License: You are free to do with these icons as you wish, including selling, copying, modifying etc. * License: MIT +* Site: [https://bitcointalk.org/index.php?topic=15276.0](https://bitcointalk.org/index.php?topic=15276.0) ### Assets Used src/qt/res/icons/transaction*.png @@ -57,15 +56,15 @@ md2k7 ----------------------- ### Info -* Designer: [http://www.everaldo.com](http://www.everaldo.com) * Icon Pack: Crystal SVG +* Designer: [http://www.everaldo.com](http://www.everaldo.com) * License: LGPL ### Assets Used src/qt/res/icons/configure.png, src/qt/res/icons/quit.png, - src/qt/res/icons/editcopy.png, src/qt/res/icons/editpaste.png, - src/qt/res/icons/add.png, src/qt/res/icons/edit.png, - src/qt/res/icons/remove.png (edited) + src/qt/res/icons/editcopy.png, src/qt/res/icons/editpaste.png, + src/qt/res/icons/add.png, src/qt/res/icons/edit.png, + src/qt/res/icons/remove.png (edited) Everaldo (Everaldo Coelho) ----------------------- @@ -75,16 +74,17 @@ Everaldo (Everaldo Coelho) * Designer: Everaldo (Everaldo Coelho) * License: GNU/GPL * Site: [http://findicons.com/icon/17102/reload?id=17102](http://findicons.com/icon/17102/reload?id=17102) + ### Assets Used - scripts/img/reload.xcf (modified), src/qt/res/movies/update_spinner.mng + scripts/img/reload.xcf (modified), src/qt/res/movies/*.png -[Vignoni David](http://www.oxygen-icons.org/) +[Vignoni David](http://www.oxygen-icons.org) ----------------------- ### Info * Designer: Vignoni David -* Site: http://www.oxygen-icons.org/ * License: Oxygen icon theme is dual licensed. You may copy it under the Creative Common Attribution-ShareAlike 3.0 License or the GNU Library General Public License. +* Site: [http://www.oxygen-icons.org](http://www.oxygen-icons.org) ### Assets Used src/qt/res/icons/debugwindow.png @@ -101,4 +101,4 @@ Jonas Schnelli src/qt/res/src/bitcoin.ico, src/qt/res/src/bitcoin.png, src/qt/res/src/bitcoin_testnet.png, docs/bitcoin_logo_doxygen.png, src/qt/res/icons/toolbar.png, src/qt/res/icons/toolbar_testnet.png, - src/qt/res/images/splash.png, src/qt/res/images/splash_testnet.png
\ No newline at end of file + src/qt/res/images/splash.png, src/qt/res/images/splash_testnet.png diff --git a/doc/build-osx.md b/doc/build-osx.md index 6268a440a8..dd343dca5f 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -5,7 +5,7 @@ This guide will show you how to build bitcoind(headless client) for OSX. Notes ----- -* Tested on OS X 10.5 through 10.8 on Intel processors only. PPC is not +* Tested on OS X 10.5 through 10.9 on Intel processors only. PPC is not supported because it is big-endian. * All of the commands should be executed in a Terminal application. The built-in one is located in `/Applications/Utilities`. @@ -27,7 +27,7 @@ not, it's the path of least resistance to install [Github for Mac](https://mac.g [Git for OS X](https://code.google.com/p/git-osx-installer/). It is also available via Homebrew or MacPorts. -You will also need to install [Homebrew](http://mxcl.github.io/homebrew/) +You will also need to install [Homebrew](http://brew.sh) or [MacPorts](https://www.macports.org/) in order to install library dependencies. It's largely a religious decision which to choose, but, as of December 2012, MacPorts is a little easier because you can just install the @@ -45,7 +45,7 @@ Instructions: MacPorts Installing the dependencies using MacPorts is very straightforward. - sudo port install boost db48@+no_java openssl miniupnpc + sudo port install boost db48@+no_java openssl miniupnpc autoconf pkgconfig automake ### Building `bitcoind` @@ -64,20 +64,20 @@ Installing the dependencies using MacPorts is very straightforward. make check -Instructions: HomeBrew +Instructions: Homebrew ---------------------- #### Install dependencies using Homebrew - brew install boost miniupnpc openssl berkeley-db4 + brew install autoconf automake berkeley-db4 boost miniupnpc openssl pkg-config protobuf -Note: After you have installed the dependencies, you should check that the Brew installed version of OpenSSL is the one available for compilation. You can check this by typing +Note: After you have installed the dependencies, you should check that the Homebrew installed version of OpenSSL is the one available for compilation. You can check this by typing openssl version -into Terminal. You should see OpenSSL 1.0.1e 11 Feb 2013. +into Terminal. You should see OpenSSL 1.0.1f 6 Jan 2014. -If not, you can ensure that the Brew OpenSSL is correctly linked by running +If not, you can ensure that the Homebrew OpenSSL is correctly linked by running brew link openssl --force diff --git a/doc/build-unix.md b/doc/build-unix.md index b88186a70e..d3a0536b10 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -68,6 +68,9 @@ for Ubuntu 12.04 and later: Ubuntu 12.04 and later have packages for libdb5.1-dev and libdb5.1++-dev, but using these will break binary wallet compatibility, and is not recommended. + +for Ubuntu 13.10: + libboost1.54-all-dev will not work. Remove libboost1.54-all-dev and install libboost1.53-all-dev for other Ubuntu & Debian: @@ -84,12 +87,18 @@ Dependencies for the GUI: Ubuntu & Debian ----------------------------------------- If you want to build Bitcoin-Qt, make sure that the required packages for Qt development -are installed. Qt 4 is currently necessary to build the GUI. +are installed. Either Qt 4 or Qt 5 are necessary to build the GUI. +If both Qt 4 and Qt 5 are installed, Qt 4 will be used. Pass `--with-gui=qt5` to configure to choose Qt5. +To build without GUI pass `--without-gui`. To build with Qt 4 you need the following: apt-get install libqt4-dev libprotobuf-dev protobuf-compiler +For Qt 5 you need the following: + + apt-get install libqt5gui5 libqt5core5 libqt5dbus5 qttools5-dev-tools libprotobuf-dev + libqrencode (optional) can be installed with: apt-get install libqrencode-dev diff --git a/doc/release-process.md b/doc/release-process.md index 2c0e2a3677..7fccf2172e 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -39,18 +39,22 @@ Release Process Fetch and build inputs: (first time, or when dependency versions change) mkdir -p inputs; cd inputs/ - wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.6.tar.gz' -O miniupnpc-1.6.tar.gz - wget 'https://www.openssl.org/source/openssl-1.0.1c.tar.gz' + wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.8.tar.gz' -O miniupnpc-1.8.tar.gz + wget 'https://www.openssl.org/source/openssl-1.0.1e.tar.gz' wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' - wget 'ftp://ftp.simplesystems.org/pub/libpng/png/src/history/zlib/zlib-1.2.6.tar.gz' - wget 'ftp://ftp.simplesystems.org/pub/libpng/png/src/history/libpng15/libpng-1.5.9.tar.gz' - wget 'https://fukuchi.org/works/qrencode/qrencode-3.2.0.tar.bz2' - wget 'https://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.bz2' + wget 'http://zlib.net/zlib-1.2.8.tar.gz' + wget 'ftp://ftp.simplesystems.org/pub/png/src/libpng16/libpng-1.6.8.tar.gz' + wget 'https://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.bz2' + wget 'https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2' wget 'https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch' -O \ boost-mingw-gas-cross-compile-2013-03-03.patch - wget 'https://download.qt-project.org/archive/qt/4.8/4.8.3/qt-everywhere-opensource-src-4.8.3.tar.gz' + wget 'https://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz' wget 'https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2' cd .. + ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-linux.yml + mv build/out/bitcoin-deps-*.zip inputs/ + ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-linux.yml + mv build/out/boost-linux-*.zip inputs/ ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-win32.yml mv build/out/boost-win32-*.zip inputs/ ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-win32.yml @@ -62,8 +66,8 @@ Release Process Build bitcoind and bitcoin-qt on Linux32, Linux64, and Win32: - ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian.yml - ./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian.yml + ./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml + ./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml pushd build/out zip -r bitcoin-${VERSION}-linux-gitian.zip * mv bitcoin-${VERSION}-linux-gitian.zip ../../../ diff --git a/qa/rpc-tests/send.sh b/qa/rpc-tests/send.sh new file mode 100755 index 0000000000..fdfb1867bc --- /dev/null +++ b/qa/rpc-tests/send.sh @@ -0,0 +1,14 @@ +#!/bin/bash +TIMEOUT=10 +SIGNAL=HUP +if [ $# -eq 0 ]; then + echo -e "Usage:\t$0 <cmd>" + echo -e "\tRuns <cmd> and wait ${TIMEOUT} seconds or until SIG${SIGNAL} is received." + echo -e "\tReturns: 0 if SIG${SIGNAL} is received, 1 otherwise." + exit 0 +fi +trap '[[ ${PID} ]] && kill ${PID}' ${SIGNAL} +"$@" +sleep ${TIMEOUT} & PID=$! +wait ${PID} && exit 1 +exit 0 diff --git a/qa/rpc-tests/util.sh b/qa/rpc-tests/util.sh index e4e3953748..fed7d32561 100644 --- a/qa/rpc-tests/util.sh +++ b/qa/rpc-tests/util.sh @@ -23,6 +23,7 @@ function CreateDataDir { echo "rpcuser=rt" >> $CONF echo "rpcpassword=rt" >> $CONF echo "rpcwait=1" >> $CONF + echo "walletnotify=killall -HUP `basename ${SENDANDWAIT}`" >> $CONF shift while (( "$#" )); do echo $1 >> $CONF @@ -59,7 +60,7 @@ function Send { to=$2 amount=$3 address=$(Address $to) - txid=$( $CLI $from sendtoaddress $address $amount ) + txid=$( ${SENDANDWAIT} $CLI $from sendtoaddress $address $amount ) } # Use: Unspent <datadir> <n'th-last-unspent> <var> @@ -80,7 +81,7 @@ function CreateTxn1 { # Use: SendRawTxn <datadir> <hex_txn_data> function SendRawTxn { - $CLI $1 sendrawtransaction $2 + ${SENDANDWAIT} $CLI $1 sendrawtransaction $2 } # Use: GetBlocks <datadir> diff --git a/qa/rpc-tests/wallet.sh b/qa/rpc-tests/wallet.sh index 118809a265..8d5a6cdc78 100755 --- a/qa/rpc-tests/wallet.sh +++ b/qa/rpc-tests/wallet.sh @@ -12,6 +12,7 @@ BITCOIND=${1}/bitcoind CLI=${1}/bitcoin-cli DIR="${BASH_SOURCE%/*}" +SENDANDWAIT="${DIR}/send.sh" if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi . "$DIR/util.sh" diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index 54ced278f2..b1c2dcb462 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -9,7 +9,7 @@ <string>APPL</string> <key>CFBundleGetInfoString</key> - <string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@, Copyright © 2009-@COPYRIGHT_YEAR@ The Bitcoin developers</string> + <string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@, Copyright © 2009-@COPYRIGHT_YEAR@ The Bitcoin Core developers</string> <key>CFBundleShortVersionString</key> <string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@</string> diff --git a/share/qt/img/reload.png b/share/qt/img/reload.png Binary files differnew file mode 100644 index 0000000000..9068db9a63 --- /dev/null +++ b/share/qt/img/reload.png diff --git a/share/qt/make_spinner.py b/share/qt/make_spinner.py index 136aff3cb7..bb19e91508 100755 --- a/share/qt/make_spinner.py +++ b/share/qt/make_spinner.py @@ -1,16 +1,15 @@ #!/usr/bin/env python # W.J. van der Laan, 2011 -# Make spinning .mng animation from a .png +# Make spinning animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen -SRC='img/reload_scaled.png' -DST='../../src/qt/res/movies/update_spinner.mng' -TMPDIR='/tmp' -TMPNAME='tmp-%03i.png' +SRC='img/reload.png' +TMPDIR='../../src/qt/res/movies/' +TMPNAME='spinner-%03i.png' NUMFRAMES=35 FRAMERATE=10.0 CONVERT='convert' @@ -36,8 +35,4 @@ for frame in xrange(NUMFRAMES): im_new.save(outfile, 'png') frame_files.append(outfile) -p = Popen([CONVERT, "-delay", str(FRAMERATE), "-dispose", "2"] + frame_files + [DST]) -p.communicate() - - diff --git a/src/Makefile.am b/src/Makefile.am index 85d7c3c9c6..f27f16ab91 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,33 +1,83 @@ include Makefile.include -AM_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv \ - -I$(builddir) +AM_CPPFLAGS += -I$(builddir) -noinst_LIBRARIES = libbitcoin_server.a libbitcoin_common.a libbitcoin_cli.a +noinst_LIBRARIES = \ + libbitcoin_server.a \ + libbitcoin_common.a \ + libbitcoin_cli.a if ENABLE_WALLET noinst_LIBRARIES += libbitcoin_wallet.a endif -bin_PROGRAMS = bitcoind bitcoin-cli +bin_PROGRAMS = + +if BUILD_BITCOIND + bin_PROGRAMS += bitcoind +endif + +if BUILD_BITCOIN_CLI + bin_PROGRAMS += bitcoin-cli +endif SUBDIRS = . $(BUILD_QT) $(BUILD_TEST) DIST_SUBDIRS = . qt test .PHONY: FORCE # bitcoin core # -BITCOIN_CORE_H = addrman.h alert.h allocators.h base58.h bignum.h \ +BITCOIN_CORE_H = \ + addrman.h \ + alert.h \ + allocators.h \ + base58.h bignum.h \ + bloom.h \ + chainparams.h \ + checkpoints.h \ + checkqueue.h \ + clientversion.h \ + coincontrol.h \ + coins.h \ + compat.h \ + core.h \ + crypter.h \ + db.h \ + hash.h \ + init.h \ + key.h \ + keystore.h \ + leveldbwrapper.h \ + limitedmap.h \ + main.h \ + miner.h \ + mruset.h \ + netbase.h \ + net.h \ + noui.h \ + protocol.h \ rpcclient.h \ rpcprotocol.h \ rpcserver.h \ - bloom.h chainparams.h checkpoints.h checkqueue.h \ - clientversion.h coincontrol.h compat.h core.h coins.h crypter.h db.h hash.h init.h \ - key.h keystore.h leveldbwrapper.h limitedmap.h main.h miner.h mruset.h \ - netbase.h net.h noui.h protocol.h script.h serialize.h sync.h threadsafety.h \ - txdb.h txmempool.h ui_interface.h uint256.h util.h version.h walletdb.h wallet.h - -JSON_H = json/json_spirit.h json/json_spirit_error_position.h \ - json/json_spirit_reader.h json/json_spirit_reader_template.h \ - json/json_spirit_stream_reader.h json/json_spirit_utils.h \ - json/json_spirit_value.h json/json_spirit_writer.h \ + script.h \ + serialize.h \ + sync.h \ + threadsafety.h \ + txdb.h \ + txmempool.h \ + ui_interface.h \ + uint256.h \ + util.h \ + version.h \ + walletdb.h \ + wallet.h + +JSON_H = \ + json/json_spirit.h \ + json/json_spirit_error_position.h \ + json/json_spirit_reader.h \ + json/json_spirit_reader_template.h \ + json/json_spirit_stream_reader.h \ + json/json_spirit_utils.h \ + json/json_spirit_value.h \ + json/json_spirit_writer.h \ json/json_spirit_writer_template.h obj/build.h: FORCE @@ -93,7 +143,12 @@ nodist_libbitcoin_common_a_SOURCES = $(top_srcdir)/src/obj/build.h # # bitcoind binary # -bitcoind_LDADD = libbitcoin_server.a libbitcoin_cli.a libbitcoin_common.a leveldb/libleveldb.a leveldb/libmemenv.a +bitcoind_LDADD = \ + libbitcoin_server.a \ + libbitcoin_cli.a \ + libbitcoin_common.a \ + $(LIBLEVELDB) \ + $(LIBMEMENV) if ENABLE_WALLET bitcoind_LDADD += libbitcoin_wallet.a endif @@ -108,7 +163,10 @@ AM_CPPFLAGS += $(BDB_CPPFLAGS) bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) # bitcoin-cli binary # -bitcoin_cli_LDADD = libbitcoin_cli.a libbitcoin_common.a $(BOOST_LIBS) +bitcoin_cli_LDADD = \ + libbitcoin_cli.a \ + libbitcoin_common.a \ + $(BOOST_LIBS) bitcoin_cli_SOURCES = bitcoin-cli.cpp # @@ -116,6 +174,7 @@ if TARGET_WINDOWS bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif +# NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race leveldb/libleveldb.a: leveldb/libmemenv.a leveldb/%.a: diff --git a/src/Makefile.include b/src/Makefile.include index 13cffd29bc..01b47d1aa0 100644 --- a/src/Makefile.include +++ b/src/Makefile.include @@ -1,23 +1,30 @@ +if EMBEDDED_LEVELDB +LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/include +LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv +LIBLEVELDB += $(top_builddir)/src/leveldb/libleveldb.a +LIBMEMENV += $(top_builddir)/src/leveldb/libmemenv.a +endif + AM_CPPFLAGS = $(INCLUDES) \ -I$(top_builddir)/src/obj \ - -I$(top_srcdir)/src/leveldb/include \ $(BDB_CPPFLAGS) \ - $(BOOST_INCLUDES) + $(BOOST_CPPFLAGS) $(BOOST_INCLUDES) +AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) AM_LDFLAGS = $(PTHREAD_CFLAGS) LIBBITCOIN_SERVER=$(top_builddir)/src/libbitcoin_server.a LIBBITCOIN_WALLET=$(top_builddir)/src/libbitcoin_wallet.a LIBBITCOIN_COMMON=$(top_builddir)/src/libbitcoin_common.a LIBBITCOIN_CLI=$(top_builddir)/src/libbitcoin_cli.a -LIBLEVELDB=$(top_builddir)/src/leveldb/libleveldb.a -LIBMEMENV=$(top_builddir)/src/leveldb/libmemenv.a LIBBITCOINQT=$(top_builddir)/src/qt/libbitcoinqt.a $(LIBBITCOIN): $(MAKE) -C $(top_builddir)/src $(@F) +if EMBEDDED_LEVELDB $(LIBLEVELDB) $(LIBMEMENV): $(MAKE) -C $(top_builddir)/src leveldb/$(@F) +endif $(LIBBITCOINQT): $(MAKE) -C $(top_builddir)/src/qt $(@F) @@ -32,23 +39,23 @@ $(LIBBITCOINQT): ui_%.h: %.ui @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(UIC) && $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@ + @test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@ $(SED) -i.bak -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ && rm $(abs_builddir)/$@.bak $(SED) -i.bak -e '/^\*\*.*by:/d' $(abs_builddir)/$@ && rm $(abs_builddir)/$@.bak %.moc: %.cpp - $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< + QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak moc_%.cpp: %.h - $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< + QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak %.qm: %.ts @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(LRELEASE) && $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ + @test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ echo error: could not build $(abs_builddir)/$@ %.pb.cc %.pb.h: %.proto diff --git a/src/bitcoin-cli-res.rc b/src/bitcoin-cli-res.rc index 337897753e..f8bfb3a881 100644 --- a/src/bitcoin-cli-res.rc +++ b/src/bitcoin-cli-res.rc @@ -5,7 +5,7 @@ #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin developers" +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core developers" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION diff --git a/src/bitcoind-res.rc b/src/bitcoind-res.rc index 202b7ab352..dc5c56b797 100644 --- a/src/bitcoind-res.rc +++ b/src/bitcoind-res.rc @@ -5,7 +5,7 @@ #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin developers" +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core developers" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 40dd30d1a4..9db1f5e100 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2013 The Bitcoin developers +// Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -50,11 +50,12 @@ namespace Checkpoints (216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")) (225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")) (250000, uint256("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")) + (279000, uint256("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")) ; static const CCheckpointData data = { &mapCheckpoints, - 1375533383, // * UNIX timestamp of last checkpoint block - 21491097, // * total number of transactions between genesis and last checkpoint + 1389047471, // * UNIX timestamp of last checkpoint block + 30549816, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) 60000.0 // * estimated number of transactions per day after checkpoint }; @@ -111,7 +112,7 @@ namespace Checkpoints double fWorkBefore = 0.0; // Amount of work done before pindex double fWorkAfter = 0.0; // Amount of work left after pindex (estimated) - // Work is defined as: 1.0 per transaction before the last checkoint, and + // Work is defined as: 1.0 per transaction before the last checkpoint, and // fSigcheckVerificationFactor per transaction after. const CCheckpointData &data = Checkpoints(); diff --git a/src/clientversion.h b/src/clientversion.h index b376a67c8a..a06ceb7505 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -19,7 +19,7 @@ // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source -#define COPYRIGHT_YEAR 2013 +#define COPYRIGHT_YEAR 2014 #endif //HAVE_CONFIG_H diff --git a/src/leveldb/db/filename.cc b/src/leveldb/db/filename.cc index da32946d99..27d750697b 100644 --- a/src/leveldb/db/filename.cc +++ b/src/leveldb/db/filename.cc @@ -29,14 +29,19 @@ std::string LogFileName(const std::string& name, uint64_t number) { return MakeFileName(name, number, "log"); } +// TableFileName returns the filenames we usually write to, while +// SSTTableFileName returns the alternative filenames we also try to read from +// for backward compatibility. For now, swap them around. +// TODO: when compatibility is no longer necessary, swap them back +// (TableFileName to use "ldb" and SSTTableFileName to use "sst"). std::string TableFileName(const std::string& name, uint64_t number) { assert(number > 0); - return MakeFileName(name, number, "ldb"); + return MakeFileName(name, number, "sst"); } std::string SSTTableFileName(const std::string& name, uint64_t number) { assert(number > 0); - return MakeFileName(name, number, "sst"); + return MakeFileName(name, number, "ldb"); } std::string DescriptorFileName(const std::string& dbname, uint64_t number) { diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 new file mode 100644 index 0000000000..5ed9692186 --- /dev/null +++ b/src/m4/bitcoin_qt.m4 @@ -0,0 +1,382 @@ +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 + AC_MSG_WARN([$1; bitcoin-qt frontend will not be built]) + fi + bitcoin_enable_qt=no + else + AC_MSG_ERROR([$1]) + fi +]) + +AC_DEFUN([BITCOIN_QT_CHECK],[ + if test "x$bitcoin_enable_qt" != "xno" && test x$bitcoin_qt_want_version != xno; then + true + $1 + else + true + $2 + fi +]) + +dnl BITCOIN_QT_PATH_PROGS([FOO], [foo foo2], [/path/to/search/first], [continue if missing]) +dnl Helper for finding the path of programs needed for Qt. +dnl Inputs: $1: Variable to be set +dnl Inputs: $2: List of programs to search for +dnl Inputs: $3: Look for $2 here before $PATH +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 + AC_PATH_PROGS($1,$2,,$3) + else + AC_PATH_PROGS($1,$2) + fi + if test "x$$1" = "x" && test "x$4" != "xyes"; then + BITCOIN_QT_FAIL([$1 not found]) + fi + ]) +]) + +dnl Initialize qt input. +dnl This must be called before any other BITCOIN_QT* macros to ensure that +dnl input variables are set correctly. +dnl CAUTION: Do not use this inside of a conditional. +AC_DEFUN([BITCOIN_QT_INIT],[ + dnl enable qt support + AC_ARG_WITH([gui], + [AS_HELP_STRING([--with-gui], + [with GUI (no|qt4|qt5|auto. default is auto, qt4 tried first.)])], + [ + bitcoin_qt_want_version=$withval + if test x$bitcoin_qt_want_version = xyes; then + bitcoin_qt_force=yes + bitcoin_qt_want_version=auto + fi + ], + [bitcoin_qt_want_version=auto]) + + AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-gui-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], []) + AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-gui-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], []) + AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-gui-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], []) + AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-gui-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], []) + + AC_ARG_WITH([qtdbus], + [AS_HELP_STRING([--with-qtdbus], + [enable DBus support (default is yes if qt is enabled and QtDBus is found)])], + [use_dbus=$withval], + [use_dbus=auto]) +]) + +dnl Find the appropriate version of Qt libraries and includes. +dnl Inputs: $1: Whether or not pkg-config should be used. yes|no. Default: yes. +dnl Inputs: $2: If $1 is "yes" and --with-gui=auto, which qt version should be +dnl tried first. +dnl Outputs: See _BITCOIN_QT_FIND_LIBS_* +dnl Outputs: Sets variables for all qt-related tools. +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 + use_pkgconfig=yes + fi + + if test x$use_pkgconfig = xyes; then + if test x$PKG_CONFIG == x; then + AC_MSG_ERROR(pkg-config not found.) + fi + BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([$2])]) + else + BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG]) + fi + + BITCOIN_QT_PATH_PROGS([MOC], [moc-qt${bitcoin_qt_got_major_vers} moc${bitcoin_qt_got_major_vers} moc], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([UIC], [uic-qt${bitcoin_qt_got_major_vers} uic${bitcoin_qt_got_major_vers} uic], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt${bitcoin_qt_got_major_vers} rcc${bitcoin_qt_got_major_vers} rcc], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt${bitcoin_qt_got_major_vers} lrelease${bitcoin_qt_got_major_vers} lrelease], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt${bitcoin_qt_got_major_vers} lupdate${bitcoin_qt_got_major_vers} lupdate],$qt_bin_path, yes) + + MOC_DEFS='-DHAVE_CONFIG_H -I$(top_srcdir)/src' + case $host in + *darwin*) + BITCOIN_QT_CHECK([ + MOC_DEFS="${MOC_DEFS} -DQ_OS_MAC" + base_frameworks="-framework Foundation -framework ApplicationServices -framework AppKit" + AX_CHECK_LINK_FLAG([[$base_frameworks]],[QT_LIBS="$QT_LIBS $base_frameworks"],[AC_MSG_ERROR(could not find base frameworks)]) + ]) + ;; + esac + + + dnl enable qt support + AC_MSG_CHECKING(whether to build Bitcoin Core GUI) + BITCOIN_QT_CHECK([ + bitcoin_enable_qt=yes + bitcoin_enable_qt_test=yes + if test x$have_qt_test = xno; then + bitcoin_enable_qt_test=no + fi + bitcoin_enable_qt_dbus=yes + if test x$have_qt_dbus = xno; then + bitcoin_enable_qt_dbus=no + if test x$use_dbus = xyes; then + AC_MSG_ERROR("libQtDBus not found. Install libQtDBus or remove --with-qtdbus.") + fi + fi + if test x$LUPDATE == x; then + AC_MSG_WARN("lupdate is required to update qt translations") + fi + ],[ + bitcoin_enable_qt=no + ]) + AC_MSG_RESULT([$bitcoin_enable_qt (Qt${bitcoin_qt_got_major_vers})]) + + AC_SUBST(QT_INCLUDES) + AC_SUBST(QT_LIBS) + AC_SUBST(QT_DBUS_INCLUDES) + AC_SUBST(QT_DBUS_LIBS) + AC_SUBST(QT_TEST_INCLUDES) + AC_SUBST(QT_TEST_LIBS) + AC_SUBST(QT_SELECT, qt${bitcoin_qt_got_major_vers}) + AC_SUBST(MOC_DEFS) +]) + +dnl All macros below are internal and should _not_ be used from the main +dnl configure.ac. +dnl ---- + +dnl Internal. Check if the included version of Qt is Qt5. +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_TRY_COMPILE( + [#include <QtCore>], + [ + #if QT_VERSION < 0x050000 + choke me + #else + return 0; + #endif + ], + bitcoin_cv_qt5=yes, + bitcoin_cv_qt5=no) +])]) + +dnl Internal. Check if the linked version of Qt was built as static libs. +dnl Requires: Qt5. This check cannot determine if Qt4 is static. +dnl Requires: INCLUDES and LIBS must be populated as necessary. +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_TRY_COMPILE( + [#include <QtCore>], + [ + #if defined(QT_STATIC) + return 0; + #else + choke me + #endif + ], + [bitcoin_cv_static_qt=yes], + [bitcoin_cv_static_qt=no]) + ]) + if test xbitcoin_cv_static_qt = xyes; then + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol for static Qt plugins]) + fi +]) + +dnl Internal. Check if the link-requirements for static plugins are met. +dnl Requires: INCLUDES and LIBS must be populated as necessary. +dnl Inputs: $1: A series of Q_IMPORT_PLUGIN(). +dnl Inputs: $2: The libraries that resolve $1. +dnl Output: QT_LIBS is prepended or configure exits. +AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[ + AC_MSG_CHECKING(for static Qt plugins: $2) + CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS" + LIBS="$2 $QT_LIBS $LIBS" + AC_TRY_LINK([ + #define QT_STATICPLUGIN + #include <QtPlugin> + $1], + [return 0;], + [AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"], + [AC_MSG_RESULT(no)]; BITCOIN_QT_FAIL(Could not resolve: $2)) + LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" +]) + +dnl Internal. Find Qt libraries using pkg-config. +dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check +dnl first. +dnl Inputs: $1: If bitcoin_qt_want_version is "auto", check for this version +dnl first. +dnl Outputs: All necessary QT_* variables are set. +dnl Outputs: bitcoin_qt_got_major_vers is set to "4" or "5". +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 + 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 + QT_LIB_PREFIX=Qt5 + bitcoin_qt_got_major_vers=5 + else + QT_LIB_PREFIX=Qt + bitcoin_qt_got_major_vers=4 + fi + 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 + PKG_CHECK_MODULES([QT], [$qt5_modules], [QT_INCLUDES="$QT_CFLAGS"; 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 + PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; 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 = x$qt5; then + PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no]) + else + PKG_CHECK_MODULES([QT], [$qt5_modules], [QT_INCLUDES="$QT_CFLAGS"; 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 + 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 + PKG_CHECK_MODULES([QT_DBUS], [${QT_LIB_PREFIX}DBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no]) + fi + ]) + ]) + true; dnl +]) + +dnl Internal. Find Qt libraries without using pkg-config. Version is deduced +dnl from the discovered headers. +dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use. +dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_QT5. +dnl Outputs: All necessary QT_* variables are set. +dnl Outputs: bitcoin_qt_got_major_vers is set to "4" or "5". +dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. +AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ + TEMP_CPPFLAGS="$CPPFLAGS" + TEMP_LIBS="$LIBS" + BITCOIN_QT_CHECK([ + 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 + ]) + + BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing))]) + BITCOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing))]) + 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 + _BITCOIN_QT_CHECK_QT5 + fi + 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 + QT_LIB_PREFIX=Qt + bitcoin_qt_got_major_vers=4 + fi + ]) + + BITCOIN_QT_CHECK([ + LIBS= + if test x$qt_lib_path != x; then + LIBS="$LIBS -L$qt_lib_path" + fi + if test x$qt_plugin_path != x; then + LIBS="$LIBS -L$qt_plugin_path/accessible" + if test x$bitcoin_qt_got_major_vers == x5; then + LIBS="$LIBS -L$qt_plugin_path/platforms" + else + LIBS="$LIBS -L$qt_plugin_path/codecs" + fi + fi + + if test x$TARGET_OS == xwindows; then + AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found)) + fi + ]) + + BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,BITCOIN_QT_FAIL(zlib not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,BITCOIN_QT_FAIL(png not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found))) + 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))) + fi + QT_LIBS="$LIBS" + LIBS="$TEMP_LIBS" + + dnl This is ugly and complicated. Yuck. Works as follows: + dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can + dnl check a header to find out. When Qt is built statically, some plugins must + dnl be linked into the final binary as well. These plugins have changed between + dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration + dnl plugin was added. Since we can't tell if Qt4 is static or not, it is + dnl assumed for all non-pkg-config builds. + dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the + dnl results to QT_LIBS. + BITCOIN_QT_CHECK([ + if test x$bitcoin_qt_got_major_vers == x5; then + _BITCOIN_QT_IS_STATIC + if test x$bitcoin_cv_static_qt == xyes; then + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets]) + if test x$TARGET_OS == xwindows; then + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) + fi + fi + else + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) + _BITCOIN_QT_CHECK_STATIC_PLUGINS([ + Q_IMPORT_PLUGIN(qcncodecs) + Q_IMPORT_PLUGIN(qjpcodecs) + Q_IMPORT_PLUGIN(qtwcodecs) + Q_IMPORT_PLUGIN(qkrcodecs) + Q_IMPORT_PLUGIN(AccessibleFactory)], + [-lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets]) + fi + ]) + + BITCOIN_QT_CHECK([ + LIBS= + 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 + LIBS= + 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) + AC_CHECK_HEADER([QtDBus],, have_qt_dbus=no) + QT_DBUS_LIBS="$LIBS" + fi + ]) + CPPFLAGS="$TEMP_CPPFLAGS" + LIBS="$TEMP_LIBS" +]) + diff --git a/src/main.cpp b/src/main.cpp index 017a0768d5..3ff1fd3a91 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,8 +56,13 @@ int64_t CTransaction::nMinRelayTxFee = 10000; static CMedianFilter<int> cPeerBlockCounts(8, 0); // Amount of blocks that other nodes claim to have -map<uint256, CBlock*> mapOrphanBlocks; -multimap<uint256, CBlock*> mapOrphanBlocksByPrev; +struct COrphanBlock { + uint256 hashBlock; + uint256 hashPrev; + vector<unsigned char> vchBlock; +}; +map<uint256, COrphanBlock*> mapOrphanBlocks; +multimap<uint256, COrphanBlock*> mapOrphanBlocksByPrev; map<uint256, CTransaction> mapOrphanTransactions; map<uint256, set<uint256> > mapOrphanTransactionsByPrev; @@ -878,11 +883,11 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock fseek(file, postx.nTxOffset, SEEK_CUR); file >> txOut; } catch (std::exception &e) { - return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__); + return error("%s : Deserialize or I/O error - %s", __PRETTY_FUNCTION__, e.what()); } hashBlock = header.GetHash(); if (txOut.GetHash() != hash) - return error("%s() : txid mismatch", __PRETTY_FUNCTION__); + return error("%s : txid mismatch", __PRETTY_FUNCTION__); return true; } } @@ -931,7 +936,7 @@ bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos) // Open history file to append CAutoFile fileout = CAutoFile(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION); if (!fileout) - return error("WriteBlockToDisk() : OpenBlockFile failed"); + return error("WriteBlockToDisk : OpenBlockFile failed"); // Write index header unsigned int nSize = fileout.GetSerializeSize(block); @@ -940,7 +945,7 @@ bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos) // Write block long fileOutPos = ftell(fileout); if (fileOutPos < 0) - return error("WriteBlockToDisk() : ftell failed"); + return error("WriteBlockToDisk : ftell failed"); pos.nPos = (unsigned int)fileOutPos; fileout << block; @@ -959,19 +964,19 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos) // Open history file to read CAutoFile filein = CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); if (!filein) - return error("ReadBlockFromDisk(CBlock&, CDiskBlockPos&) : OpenBlockFile failed"); + return error("ReadBlockFromDisk : OpenBlockFile failed"); // Read block try { filein >> block; } catch (std::exception &e) { - return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__); + return error("%s : Deserialize or I/O error - %s", __PRETTY_FUNCTION__, e.what()); } // Check the header if (!CheckProofOfWork(block.GetHash(), block.nBits)) - return error("ReadBlockFromDisk(CBlock&, CDiskBlockPos&) : errors in block header"); + return error("ReadBlockFromDisk : Errors in block header"); return true; } @@ -985,12 +990,19 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex) return true; } -uint256 static GetOrphanRoot(const CBlockHeader* pblock) +uint256 static GetOrphanRoot(const uint256& hash) { + map<uint256, COrphanBlock*>::iterator it = mapOrphanBlocks.find(hash); + if (it == mapOrphanBlocks.end()) + return hash; + // Work back to the first block in the orphan chain - while (mapOrphanBlocks.count(pblock->hashPrevBlock)) - pblock = mapOrphanBlocks[pblock->hashPrevBlock]; - return pblock->GetHash(); + do { + map<uint256, COrphanBlock*>::iterator it2 = mapOrphanBlocks.find(it->second->hashPrev); + if (it2 == mapOrphanBlocks.end()) + return it->first; + it = it2; + } while(true); } int64_t GetBlockValue(int nHeight, int64_t nFees) @@ -2277,12 +2289,19 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl // Accept orphans as long as there is a node to request its parents from if (pfrom) { - CBlock* pblock2 = new CBlock(*pblock); + COrphanBlock* pblock2 = new COrphanBlock(); + { + CDataStream ss(SER_DISK, CLIENT_VERSION); + ss << *pblock; + pblock2->vchBlock = std::vector<unsigned char>(ss.begin(), ss.end()); + } + pblock2->hashBlock = hash; + pblock2->hashPrev = pblock->hashPrevBlock; mapOrphanBlocks.insert(make_pair(hash, pblock2)); - mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrevBlock, pblock2)); + mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrev, pblock2)); // Ask this guy to fill in what we're missing - PushGetBlocks(pfrom, chainActive.Tip(), GetOrphanRoot(pblock2)); + PushGetBlocks(pfrom, chainActive.Tip(), GetOrphanRoot(hash)); } return true; } @@ -2297,17 +2316,22 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl for (unsigned int i = 0; i < vWorkQueue.size(); i++) { uint256 hashPrev = vWorkQueue[i]; - for (multimap<uint256, CBlock*>::iterator mi = mapOrphanBlocksByPrev.lower_bound(hashPrev); + for (multimap<uint256, COrphanBlock*>::iterator mi = mapOrphanBlocksByPrev.lower_bound(hashPrev); mi != mapOrphanBlocksByPrev.upper_bound(hashPrev); ++mi) { - CBlock* pblockOrphan = (*mi).second; + CBlock block; + { + CDataStream ss(mi->second->vchBlock, SER_DISK, CLIENT_VERSION); + ss >> block; + } + block.BuildMerkleTree(); // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan resolution (that is, feeding people an invalid block based on LegitBlockX in order to get anyone relaying LegitBlockX banned) CValidationState stateDummy; - if (AcceptBlock(*pblockOrphan, stateDummy)) - vWorkQueue.push_back(pblockOrphan->GetHash()); - mapOrphanBlocks.erase(pblockOrphan->GetHash()); - delete pblockOrphan; + if (AcceptBlock(block, stateDummy)) + vWorkQueue.push_back(mi->second->hashBlock); + mapOrphanBlocks.erase(mi->second->hashBlock); + delete mi->second; } mapOrphanBlocksByPrev.erase(hashPrev); } @@ -2852,7 +2876,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp) break; } } catch (std::exception &e) { - LogPrintf("%s() : Deserialize or I/O error caught during load\n", __PRETTY_FUNCTION__); + LogPrintf("%s : Deserialize or I/O error - %s", __PRETTY_FUNCTION__, e.what()); } } fclose(fileIn); @@ -3331,7 +3355,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (!fImporting && !fReindex) pfrom->AskFor(inv); } else if (inv.type == MSG_BLOCK && mapOrphanBlocks.count(inv.hash)) { - PushGetBlocks(pfrom, chainActive.Tip(), GetOrphanRoot(mapOrphanBlocks[inv.hash])); + PushGetBlocks(pfrom, chainActive.Tip(), GetOrphanRoot(inv.hash)); } else if (nInv == nLastBlock) { // In case we are on a very long side-chain, it is possible that we already have // the last block in an inv bundle sent in response to getblocks. Try to detect @@ -4119,7 +4143,7 @@ public: mapBlockIndex.clear(); // orphan blocks - std::map<uint256, CBlock*>::iterator it2 = mapOrphanBlocks.begin(); + std::map<uint256, COrphanBlock*>::iterator it2 = mapOrphanBlocks.begin(); for (; it2 != mapOrphanBlocks.end(); it2++) delete (*it2).second; mapOrphanBlocks.clear(); diff --git a/src/main.h b/src/main.h index f3f9acb639..60e733b23a 100644 --- a/src/main.h +++ b/src/main.h @@ -336,7 +336,7 @@ public: // Open history file to append CAutoFile fileout = CAutoFile(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION); if (!fileout) - return error("CBlockUndo::WriteToDisk() : OpenUndoFile failed"); + return error("CBlockUndo::WriteToDisk : OpenUndoFile failed"); // Write index header unsigned int nSize = fileout.GetSerializeSize(*this); @@ -345,7 +345,7 @@ public: // Write undo data long fileOutPos = ftell(fileout); if (fileOutPos < 0) - return error("CBlockUndo::WriteToDisk() : ftell failed"); + return error("CBlockUndo::WriteToDisk : ftell failed"); pos.nPos = (unsigned int)fileOutPos; fileout << *this; @@ -368,7 +368,7 @@ public: // Open history file to read CAutoFile filein = CAutoFile(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION); if (!filein) - return error("CBlockUndo::ReadFromDisk() : OpenBlockFile failed"); + return error("CBlockUndo::ReadFromDisk : OpenBlockFile failed"); // Read block uint256 hashChecksum; @@ -377,7 +377,7 @@ public: filein >> hashChecksum; } catch (std::exception &e) { - return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__); + return error("%s : Deserialize or I/O error - %s", __PRETTY_FUNCTION__, e.what()); } // Verify checksum @@ -385,7 +385,7 @@ public: hasher << hashBlock; hasher << *this; if (hashChecksum != hasher.GetHash()) - return error("CBlockUndo::ReadFromDisk() : checksum mismatch"); + return error("CBlockUndo::ReadFromDisk : Checksum mismatch"); return true; } @@ -209,7 +209,7 @@ public: std::string addrName; CService addrLocal; int nVersion; - // strSubVer is whatever byte array we read from the wire. However, this field is intended + // strSubVer is whatever byte array we read from the wire. However, this field is intended // to be printed out, displayed to humans in various forms and so on. So we sanitize it and // store the sanitized version in cleanSubVer. The original should be used when dealing with // the network or wire types and the cleaned string used when displayed or logged. @@ -264,7 +264,7 @@ public: int64_t nPingUsecStart; int64_t nPingUsecTime; bool fPingQueued; - + CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION) { nServices = 0; diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am index 863274e80c..cac6039663 100644 --- a/src/qt/Makefile.am +++ b/src/qt/Makefile.am @@ -74,41 +74,79 @@ QT_TS = \ locale/bitcoin_zh_CN.ts \ locale/bitcoin_zh_TW.ts -QT_FORMS_UI = forms/aboutdialog.ui forms/addressbookpage.ui \ +QT_FORMS_UI = \ + forms/aboutdialog.ui \ + forms/addressbookpage.ui \ forms/askpassphrasedialog.ui \ forms/coincontroldialog.ui \ forms/editaddressdialog.ui \ + forms/helpmessagedialog.ui \ forms/intro.ui \ forms/openuridialog.ui \ - forms/optionsdialog.ui forms/overviewpage.ui forms/receiverequestdialog.ui \ + forms/optionsdialog.ui \ + forms/overviewpage.ui \ forms/receivecoinsdialog.ui \ - forms/rpcconsole.ui forms/sendcoinsdialog.ui forms/sendcoinsentry.ui \ - forms/signverifymessagedialog.ui forms/transactiondescdialog.ui + forms/receiverequestdialog.ui \ + forms/rpcconsole.ui \ + forms/sendcoinsdialog.ui \ + forms/sendcoinsentry.ui \ + forms/signverifymessagedialog.ui \ + forms/transactiondescdialog.ui -QT_MOC_CPP = moc_aboutdialog.cpp moc_addressbookpage.cpp \ - moc_addresstablemodel.cpp moc_askpassphrasedialog.cpp \ - moc_bitcoinaddressvalidator.cpp moc_bitcoinamountfield.cpp \ - moc_bitcoingui.cpp moc_bitcoinunits.cpp moc_clientmodel.cpp \ +QT_MOC_CPP = \ + moc_addressbookpage.cpp \ + moc_addresstablemodel.cpp \ + moc_askpassphrasedialog.cpp \ + moc_bitcoinaddressvalidator.cpp \ + moc_bitcoinamountfield.cpp \ + moc_bitcoingui.cpp \ + moc_bitcoinunits.cpp \ + moc_clientmodel.cpp \ moc_coincontroldialog.cpp \ moc_coincontroltreewidget.cpp \ - moc_csvmodelwriter.cpp moc_editaddressdialog.cpp moc_guiutil.cpp \ - moc_intro.cpp moc_macdockiconhandler.cpp moc_macnotificationhandler.cpp \ - moc_monitoreddatamapper.cpp moc_notificator.cpp \ + moc_csvmodelwriter.cpp \ + moc_editaddressdialog.cpp \ + moc_guiutil.cpp \ + moc_intro.cpp \ + moc_macdockiconhandler.cpp \ + moc_macnotificationhandler.cpp \ + moc_monitoreddatamapper.cpp \ + moc_notificator.cpp \ moc_openuridialog.cpp \ moc_optionsdialog.cpp \ - moc_optionsmodel.cpp moc_overviewpage.cpp moc_paymentserver.cpp \ - moc_receiverequestdialog.cpp moc_qvalidatedlineedit.cpp moc_qvaluecombobox.cpp \ + moc_optionsmodel.cpp \ + moc_overviewpage.cpp \ + moc_paymentserver.cpp \ + moc_qvalidatedlineedit.cpp \ + moc_qvaluecombobox.cpp \ moc_receivecoinsdialog.cpp \ + moc_receiverequestdialog.cpp \ moc_recentrequeststablemodel.cpp \ - moc_rpcconsole.cpp moc_sendcoinsdialog.cpp moc_sendcoinsentry.cpp \ - moc_signverifymessagedialog.cpp moc_splashscreen.cpp moc_trafficgraphwidget.cpp moc_transactiondesc.cpp \ - moc_transactiondescdialog.cpp moc_transactionfilterproxy.cpp \ - moc_transactiontablemodel.cpp moc_transactionview.cpp moc_walletframe.cpp \ - moc_walletmodel.cpp moc_walletview.cpp + moc_rpcconsole.cpp \ + moc_sendcoinsdialog.cpp \ + moc_sendcoinsentry.cpp \ + moc_signverifymessagedialog.cpp \ + moc_splashscreen.cpp \ + moc_trafficgraphwidget.cpp \ + moc_transactiondesc.cpp \ + moc_transactiondescdialog.cpp \ + moc_transactionfilterproxy.cpp \ + moc_transactiontablemodel.cpp \ + moc_transactionview.cpp \ + moc_utilitydialog.cpp \ + moc_walletframe.cpp \ + moc_walletmodel.cpp \ + moc_walletview.cpp -BITCOIN_MM = macdockiconhandler.mm macnotificationhandler.mm +BITCOIN_MM = \ + macdockiconhandler.mm \ + macnotificationhandler.mm -QT_MOC = intro.moc overviewpage.moc rpcconsole.moc +QT_MOC = \ + bitcoin.moc \ + intro.moc \ + overviewpage.moc \ + rpcconsole.moc QT_QRC_CPP = qrc_bitcoin.cpp QT_QRC = bitcoin.qrc @@ -117,62 +155,156 @@ PROTOBUF_CC = paymentrequest.pb.cc PROTOBUF_H = paymentrequest.pb.h PROTOBUF_PROTO = paymentrequest.proto -BITCOIN_QT_H = aboutdialog.h addressbookpage.h addresstablemodel.h \ - askpassphrasedialog.h bitcoinaddressvalidator.h bitcoinamountfield.h \ - bitcoingui.h bitcoinunits.h clientmodel.h coincontroldialog.h coincontroltreewidget.h csvmodelwriter.h \ - editaddressdialog.h guiconstants.h guiutil.h intro.h macdockiconhandler.h \ - macnotificationhandler.h monitoreddatamapper.h notificator.h \ +BITCOIN_QT_H = \ + addressbookpage.h \ + addresstablemodel.h \ + askpassphrasedialog.h \ + bitcoinaddressvalidator.h \ + bitcoinamountfield.h \ + bitcoingui.h \ + bitcoinunits.h \ + clientmodel.h \ + coincontroldialog.h \ + coincontroltreewidget.h \ + csvmodelwriter.h \ + editaddressdialog.h \ + guiconstants.h \ + guiutil.h \ + intro.h \ + macdockiconhandler.h \ + macnotificationhandler.h \ + monitoreddatamapper.h \ + notificator.h \ openuridialog.h \ optionsdialog.h \ - optionsmodel.h overviewpage.h paymentrequestplus.h paymentserver.h \ + optionsmodel.h \ + overviewpage.h \ + paymentrequestplus.h \ + paymentserver.h \ + qvalidatedlineedit.h \ + qvaluecombobox.h \ receivecoinsdialog.h \ + receiverequestdialog.h \ recentrequeststablemodel.h \ - receiverequestdialog.h qvalidatedlineedit.h qvaluecombobox.h rpcconsole.h \ - sendcoinsdialog.h sendcoinsentry.h signverifymessagedialog.h splashscreen.h \ - trafficgraphwidget.h transactiondescdialog.h transactiondesc.h transactionfilterproxy.h \ - transactionrecord.h transactiontablemodel.h transactionview.h walletframe.h \ - walletmodel.h walletmodeltransaction.h walletview.h - -RES_ICONS = res/icons/bitcoin.png res/icons/address-book.png \ - res/icons/quit.png res/icons/send.png res/icons/toolbar.png \ - res/icons/connect0_16.png res/icons/connect1_16.png \ - res/icons/connect2_16.png res/icons/connect3_16.png \ - res/icons/connect4_16.png res/icons/transaction0.png \ - res/icons/transaction2.png res/icons/clock1.png res/icons/clock2.png \ - res/icons/clock3.png res/icons/clock4.png res/icons/clock5.png \ - res/icons/configure.png res/icons/receive.png res/icons/editpaste.png \ - res/icons/editcopy.png res/icons/add.png res/icons/bitcoin_testnet.png \ - res/icons/toolbar_testnet.png res/icons/edit.png res/icons/history.png \ - res/icons/overview.png res/icons/export.png res/icons/synced.png \ - res/icons/remove.png res/icons/tx_mined.png res/icons/tx_input.png \ - res/icons/tx_output.png res/icons/tx_inout.png res/icons/lock_closed.png \ - res/icons/lock_open.png res/icons/key.png res/icons/filesave.png \ - res/icons/qrcode.png res/icons/debugwindow.png res/icons/bitcoin.ico \ - res/icons/bitcoin_testnet.ico - -BITCOIN_QT_CPP = aboutdialog.cpp addressbookpage.cpp \ - addresstablemodel.cpp askpassphrasedialog.cpp bitcoinaddressvalidator.cpp \ - bitcoinamountfield.cpp bitcoin.cpp bitcoingui.cpp \ - bitcoinunits.cpp clientmodel.cpp \ + rpcconsole.h \ + sendcoinsdialog.h \ + sendcoinsentry.h \ + signverifymessagedialog.h \ + splashscreen.h \ + trafficgraphwidget.h \ + transactiondesc.h \ + transactiondescdialog.h \ + transactionfilterproxy.h \ + transactionrecord.h \ + transactiontablemodel.h \ + transactionview.h \ + utilitydialog.h \ + walletframe.h \ + walletmodel.h \ + walletmodeltransaction.h \ + walletview.h + +RES_ICONS = \ + res/icons/add.png \ + res/icons/address-book.png \ + res/icons/bitcoin.ico \ + res/icons/bitcoin.png \ + res/icons/bitcoin_testnet.ico \ + res/icons/bitcoin_testnet.png \ + res/icons/clock1.png \ + res/icons/clock2.png \ + res/icons/clock3.png \ + res/icons/clock4.png \ + res/icons/clock5.png \ + res/icons/configure.png \ + res/icons/connect0_16.png \ + res/icons/connect1_16.png \ + res/icons/connect2_16.png \ + res/icons/connect3_16.png \ + res/icons/connect4_16.png \ + res/icons/debugwindow.png \ + res/icons/edit.png \ + res/icons/editcopy.png \ + res/icons/editpaste.png \ + res/icons/export.png \ + res/icons/filesave.png \ + res/icons/history.png \ + res/icons/key.png \ + res/icons/lock_closed.png \ + res/icons/lock_open.png \ + res/icons/overview.png \ + res/icons/qrcode.png \ + res/icons/quit.png \ + res/icons/receive.png \ + res/icons/remove.png \ + res/icons/send.png \ + res/icons/synced.png \ + res/icons/toolbar.png \ + res/icons/toolbar_testnet.png \ + res/icons/transaction0.png \ + res/icons/transaction2.png \ + res/icons/tx_inout.png \ + res/icons/tx_input.png \ + res/icons/tx_output.png \ + res/icons/tx_mined.png + +BITCOIN_QT_CPP = \ + bitcoin.cpp \ + bitcoinaddressvalidator.cpp \ + bitcoinamountfield.cpp \ + bitcoingui.cpp \ + bitcoinunits.cpp \ + clientmodel.cpp \ + csvmodelwriter.cpp \ + guiutil.cpp \ + intro.cpp \ + monitoreddatamapper.cpp \ + notificator.cpp \ + optionsdialog.cpp \ + optionsmodel.cpp \ + qvalidatedlineedit.cpp \ + qvaluecombobox.cpp \ + rpcconsole.cpp \ + signverifymessagedialog.cpp \ + splashscreen.cpp \ + trafficgraphwidget.cpp \ + utilitydialog.cpp + +if ENABLE_WALLET +BITCOIN_QT_CPP += \ + addressbookpage.cpp \ + addresstablemodel.cpp \ + askpassphrasedialog.cpp \ coincontroldialog.cpp \ coincontroltreewidget.cpp \ - csvmodelwriter.cpp editaddressdialog.cpp \ - guiutil.cpp intro.cpp monitoreddatamapper.cpp notificator.cpp \ + editaddressdialog.cpp \ openuridialog.cpp \ - optionsdialog.cpp optionsmodel.cpp overviewpage.cpp paymentrequestplus.cpp \ - paymentserver.cpp qvalidatedlineedit.cpp qvaluecombobox.cpp \ - receivecoinsdialog.cpp receiverequestdialog.cpp \ + overviewpage.cpp \ + paymentrequestplus.cpp \ + paymentserver.cpp \ + receivecoinsdialog.cpp \ + receiverequestdialog.cpp \ recentrequeststablemodel.cpp \ - rpcconsole.cpp sendcoinsdialog.cpp sendcoinsentry.cpp \ - signverifymessagedialog.cpp splashscreen.cpp trafficgraphwidget.cpp transactiondesc.cpp \ - transactiondescdialog.cpp transactionfilterproxy.cpp transactionrecord.cpp \ - transactiontablemodel.cpp transactionview.cpp walletframe.cpp \ - walletmodel.cpp walletmodeltransaction.cpp walletview.cpp + sendcoinsdialog.cpp \ + sendcoinsentry.cpp \ + transactiondesc.cpp \ + transactiondescdialog.cpp \ + transactionfilterproxy.cpp \ + transactionrecord.cpp \ + transactiontablemodel.cpp \ + transactionview.cpp \ + walletframe.cpp \ + walletmodel.cpp \ + walletmodeltransaction.cpp \ + walletview.cpp +endif -RES_IMAGES = res/images/about.png res/images/splash.png \ +RES_IMAGES = \ + res/images/about.png \ + res/images/splash.png \ res/images/splash_testnet.png -RES_MOVIES = res/movies/update_spinner.mng +RES_MOVIES = $(wildcard res/movies/spinner-*.png) BITCOIN_RC = res/bitcoin-qt-res.rc @@ -203,7 +335,11 @@ endif bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ -I$(top_srcdir)/src/qt/forms bitcoin_qt_SOURCES = bitcoin.cpp -bitcoin_qt_LDADD = libbitcoinqt.a $(LIBBITCOIN_SERVER) $(LIBBITCOIN_WALLET) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ +bitcoin_qt_LDADD = libbitcoinqt.a $(LIBBITCOIN_SERVER) +if ENABLE_WALLET +bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) +endif +bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) # forms/foo.h -> forms/ui_foo.h @@ -220,10 +356,10 @@ bitcoinstrings.cpp: FORCE translate: 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" - @$(LUPDATE) $^ -locations relative -no-obsolete -ts locale/bitcoin_en.ts + @QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts locale/bitcoin_en.ts $(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) - @cd $(abs_srcdir); test -f $(RCC) && $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \ + @cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \ echo error: could not build $@ $(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak $(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak diff --git a/src/qt/aboutdialog.cpp b/src/qt/aboutdialog.cpp deleted file mode 100644 index 797ebf97ed..0000000000 --- a/src/qt/aboutdialog.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2011-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "aboutdialog.h" -#include "ui_aboutdialog.h" - -#include "clientmodel.h" - -#include "clientversion.h" - -AboutDialog::AboutDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::AboutDialog) -{ - ui->setupUi(this); - - // Set current copyright year - ui->copyrightLabel->setText(tr("Copyright") + QString(" © 2009-%1 ").arg(COPYRIGHT_YEAR) + tr("The Bitcoin developers")); -} - -void AboutDialog::setModel(ClientModel *model) -{ - if(model) - { - ui->versionLabel->setText(model->formatFullVersion()); - } -} - -AboutDialog::~AboutDialog() -{ - delete ui; -} - -void AboutDialog::on_buttonBox_accepted() -{ - close(); -} diff --git a/src/qt/aboutdialog.h b/src/qt/aboutdialog.h deleted file mode 100644 index 1b131c4dcc..0000000000 --- a/src/qt/aboutdialog.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2011-2013 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef ABOUTDIALOG_H -#define ABOUTDIALOG_H - -#include <QDialog> - -class ClientModel; - -namespace Ui { - class AboutDialog; -} - -/** "About" dialog box */ -class AboutDialog : public QDialog -{ - Q_OBJECT - -public: - explicit AboutDialog(QWidget *parent); - ~AboutDialog(); - - void setModel(ClientModel *model); - -private: - Ui::AboutDialog *ui; - -private slots: - void on_buttonBox_accepted(); -}; - -#endif // ABOUTDIALOG_H diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 9565d3ef7a..848e50deb0 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "bitcoin-config.h" +#endif + #include "bitcoingui.h" #include "clientmodel.h" @@ -9,9 +13,12 @@ #include "guiutil.h" #include "intro.h" #include "optionsmodel.h" -#include "paymentserver.h" #include "splashscreen.h" +#include "utilitydialog.h" +#ifdef ENABLE_WALLET +#include "paymentserver.h" #include "walletmodel.h" +#endif #include "init.h" #include "main.h" @@ -29,59 +36,31 @@ #include <QSettings> #include <QTimer> #include <QTranslator> +#include <QThread> -#if QT_VERSION < 0x050000 -#include <QTextCodec> -#endif - -#if defined(BITCOIN_NEED_QT_PLUGINS) && !defined(_BITCOIN_QT_PLUGINS_INCLUDED) -#define _BITCOIN_QT_PLUGINS_INCLUDED -#define __INSURE__ +#if defined(QT_STATICPLUGIN) #include <QtPlugin> +#if QT_VERSION < 0x050000 Q_IMPORT_PLUGIN(qcncodecs) Q_IMPORT_PLUGIN(qjpcodecs) Q_IMPORT_PLUGIN(qtwcodecs) Q_IMPORT_PLUGIN(qkrcodecs) Q_IMPORT_PLUGIN(qtaccessiblewidgets) +#else +Q_IMPORT_PLUGIN(AccessibleFactory) +Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); +#endif +#endif + +#if QT_VERSION < 0x050000 +#include <QTextCodec> #endif // Declare meta types used for QMetaObject::invokeMethod Q_DECLARE_METATYPE(bool*) -// Need a global reference for the notifications to find the GUI -static BitcoinGUI *guiref; -static SplashScreen *splashref; - -static bool ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) -{ - if(guiref) - { - bool modal = (style & CClientUIInterface::MODAL); - bool ret = false; - // In case of modal message, use blocking connection to wait for user to click a button - QMetaObject::invokeMethod(guiref, "message", - modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection, - Q_ARG(QString, QString::fromStdString(caption)), - Q_ARG(QString, QString::fromStdString(message)), - Q_ARG(unsigned int, style), - Q_ARG(bool*, &ret)); - return ret; - } - else - { - LogPrintf("%s: %s\n", caption.c_str(), message.c_str()); - fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str()); - return false; - } -} - static void InitMessage(const std::string &message) { - if(splashref) - { - splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(55,55,55)); - qApp->processEvents(); - } LogPrintf("init message: %s\n", message.c_str()); } @@ -93,15 +72,6 @@ static std::string Translate(const char* psz) return QCoreApplication::translate("bitcoin-core", psz).toStdString(); } -/* Handle runaway exceptions. Shows a message box with the problem and quits the program. - */ -static void handleRunawayException(std::exception *e) -{ - PrintExceptionContinue(e, "Runaway exception"); - QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning)); - exit(1); -} - /** Set up translations */ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTranslator, QTranslator &translatorBase, QTranslator &translator) { @@ -158,25 +128,331 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons } #endif +/** Class encapsulating Bitcoin Core startup and shutdown. + * Allows running startup and shutdown in a different thread from the UI thread. + */ +class BitcoinCore: public QObject +{ + Q_OBJECT +public: + explicit BitcoinCore(); + +public slots: + void initialize(); + void shutdown(); + +signals: + void initializeResult(int retval); + void shutdownResult(int retval); + void runawayException(const QString &message); + +private: + boost::thread_group threadGroup; + + /// Pass fatal exception message to UI thread + void handleRunawayException(std::exception *e); +}; + +/** Main Bitcoin application object */ +class BitcoinApplication: public QApplication +{ + Q_OBJECT +public: + explicit BitcoinApplication(int &argc, char **argv); + ~BitcoinApplication(); + +#ifdef ENABLE_WALLET + /// Create payment server + void createPaymentServer(); +#endif + /// Create options model + void createOptionsModel(); + /// Create main window + void createWindow(bool isaTestNet); + /// Create splash screen + void createSplashScreen(bool isaTestNet); + + /// Request core initialization + void requestInitialize(); + /// Request core shutdown + void requestShutdown(); + + /// Get process return value + int getReturnValue() { return returnValue; } + +public slots: + void initializeResult(int retval); + void shutdownResult(int retval); + /// Handle runaway exceptions. Shows a message box with the problem and quits the program. + void handleRunawayException(const QString &message); + +signals: + void requestedInitialize(); + void requestedShutdown(); + void stopThread(); + void splashFinished(QWidget *window); + +private: + QThread *coreThread; + OptionsModel *optionsModel; + ClientModel *clientModel; + BitcoinGUI *window; + QTimer *pollShutdownTimer; +#ifdef ENABLE_WALLET + PaymentServer* paymentServer; + WalletModel *walletModel; +#endif + int returnValue; + + void startThread(); +}; + +#include "bitcoin.moc" + +BitcoinCore::BitcoinCore(): + QObject() +{ +} + +void BitcoinCore::handleRunawayException(std::exception *e) +{ + PrintExceptionContinue(e, "Runaway exception"); + emit runawayException(QString::fromStdString(strMiscWarning)); +} + +void BitcoinCore::initialize() +{ + try + { + LogPrintf("Running AppInit2 in thread\n"); + int rv = AppInit2(threadGroup); + emit initializeResult(rv); + } catch (std::exception& e) { + handleRunawayException(&e); + } catch (...) { + handleRunawayException(NULL); + } +} + +void BitcoinCore::shutdown() +{ + try + { + LogPrintf("Running Shutdown in thread\n"); + threadGroup.interrupt_all(); + threadGroup.join_all(); + Shutdown(); + LogPrintf("Shutdown finished\n"); + emit shutdownResult(1); + } catch (std::exception& e) { + handleRunawayException(&e); + } catch (...) { + handleRunawayException(NULL); + } +} + +BitcoinApplication::BitcoinApplication(int &argc, char **argv): + QApplication(argc, argv), + coreThread(0), + optionsModel(0), + clientModel(0), + window(0), + pollShutdownTimer(0), +#ifdef ENABLE_WALLET + paymentServer(0), + walletModel(0), +#endif + returnValue(0) +{ + setQuitOnLastWindowClosed(false); + startThread(); +} + +BitcoinApplication::~BitcoinApplication() +{ + LogPrintf("Stopping thread\n"); + emit stopThread(); + coreThread->wait(); + LogPrintf("Stopped thread\n"); + + delete window; + window = 0; +#ifdef ENABLE_WALLET + delete paymentServer; + paymentServer = 0; +#endif + delete optionsModel; + optionsModel = 0; +} + +#ifdef ENABLE_WALLET +void BitcoinApplication::createPaymentServer() +{ + paymentServer = new PaymentServer(this); +} +#endif + +void BitcoinApplication::createOptionsModel() +{ + optionsModel = new OptionsModel(); +} + +void BitcoinApplication::createWindow(bool isaTestNet) +{ + window = new BitcoinGUI(isaTestNet, 0); + + pollShutdownTimer = new QTimer(window); + connect(pollShutdownTimer, SIGNAL(timeout()), window, SLOT(detectShutdown())); + pollShutdownTimer->start(200); +} + +void BitcoinApplication::createSplashScreen(bool isaTestNet) +{ + SplashScreen *splash = new SplashScreen(QPixmap(), 0, isaTestNet); + splash->setAttribute(Qt::WA_DeleteOnClose); + splash->show(); + connect(this, SIGNAL(splashFinished(QWidget*)), splash, SLOT(slotFinish(QWidget*))); +} + +void BitcoinApplication::startThread() +{ + coreThread = new QThread(this); + BitcoinCore *executor = new BitcoinCore(); + executor->moveToThread(coreThread); + + /* communication to and from thread */ + connect(executor, SIGNAL(initializeResult(int)), this, SLOT(initializeResult(int))); + connect(executor, SIGNAL(shutdownResult(int)), this, SLOT(shutdownResult(int))); + connect(executor, SIGNAL(runawayException(QString)), this, SLOT(handleRunawayException(QString))); + connect(this, SIGNAL(requestedInitialize()), executor, SLOT(initialize())); + connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown())); + /* make sure executor object is deleted in its own thread */ + connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater())); + connect(this, SIGNAL(stopThread()), coreThread, SLOT(quit())); + + coreThread->start(); +} + +void BitcoinApplication::requestInitialize() +{ + LogPrintf("Requesting initialize\n"); + emit requestedInitialize(); +} + +void BitcoinApplication::requestShutdown() +{ + LogPrintf("Requesting shutdown\n"); + window->hide(); + window->setClientModel(0); + pollShutdownTimer->stop(); + +#ifdef ENABLE_WALLET + window->removeAllWallets(); + delete walletModel; + walletModel = 0; +#endif + delete clientModel; + clientModel = 0; + + // Show a simple window indicating shutdown status + ShutdownWindow::showShutdownWindow(window); + + // Request shutdown from core thread + emit requestedShutdown(); +} + +void BitcoinApplication::initializeResult(int retval) +{ + LogPrintf("Initialization result: %i\n", retval); + // Set exit result: 0 if successful, 1 if failure + returnValue = retval ? 0 : 1; + if(retval) + { + // Miscellaneous initialization after core is initialized + optionsModel->Upgrade(); // Must be done after AppInit2 + +#ifdef ENABLE_WALLET + PaymentServer::LoadRootCAs(); + paymentServer->setOptionsModel(optionsModel); +#endif + + emit splashFinished(window); + + clientModel = new ClientModel(optionsModel); + window->setClientModel(clientModel); + +#ifdef ENABLE_WALLET + if(pwalletMain) + { + walletModel = new WalletModel(pwalletMain, optionsModel); + + window->addWallet("~Default", walletModel); + window->setCurrentWallet("~Default"); + + connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)), + paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray))); + } +#endif + + // If -min option passed, start window minimized. + if(GetBoolArg("-min", false)) + { + window->showMinimized(); + } + else + { + window->show(); + } +#ifdef ENABLE_WALLET + // Now that initialization/startup is done, process any command-line + // bitcoin: URIs or payment requests: + connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), + window, SLOT(handlePaymentRequest(SendCoinsRecipient))); + connect(window, SIGNAL(receivedURI(QString)), + paymentServer, SLOT(handleURIOrFile(QString))); + connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)), + window, SLOT(message(QString,QString,unsigned int))); + QTimer::singleShot(100, paymentServer, SLOT(uiReady())); +#endif + } else { + quit(); // Exit main loop + } +} + +void BitcoinApplication::shutdownResult(int retval) +{ + LogPrintf("Shutdown result: %i\n", retval); + quit(); // Exit main loop after shutdown finished +} + +void BitcoinApplication::handleRunawayException(const QString &message) +{ + QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + message); + ::exit(1); +} + #ifndef BITCOIN_QT_TEST int main(int argc, char *argv[]) { - bool fMissingDatadir = false; bool fSelParFromCLFailed = false; - + /// 1. Parse command-line options. These take precedence over anything else. // Command-line options take precedence: ParseParameters(argc, argv); - // ... then bitcoin.conf: - if (!boost::filesystem::is_directory(GetDataDir(false))) { - fMissingDatadir = true; - } else { - ReadConfigFile(mapArgs, mapMultiArgs); - } // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { fSelParFromCLFailed = true; } +#ifdef ENABLE_WALLET + // Parse URIs on command line -- this can affect TestNet() / RegTest() mode + if (!PaymentServer::ipcParseCommandLine(argc, argv)) + exit(0); +#endif + + bool isaTestNet = TestNet() || RegTest(); + + // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory + /// 2. Basic Qt initialization (not dependent on parameters or configuration) #if QT_VERSION < 0x050000 // Internal string conversion is all UTF-8 QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); @@ -184,7 +460,7 @@ int main(int argc, char *argv[]) #endif Q_INIT_RESOURCE(bitcoin); - QApplication app(argc, argv); + BitcoinApplication app(argc, argv); #if QT_VERSION > 0x050100 // Generate high-dpi pixmaps QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); @@ -196,9 +472,9 @@ int main(int argc, char *argv[]) // Register meta types used for QMetaObject::invokeMethod qRegisterMetaType< bool* >(); - // Application identification (must be set before OptionsModel is initialized, - // as it is used to locate QSettings) - bool isaTestNet = TestNet() || RegTest(); + /// 3. Application identification + // must be set before OptionsModel is initialized or translations are loaded, + // as it is used to locate QSettings QApplication::setOrganizationName("Bitcoin"); QApplication::setOrganizationDomain("bitcoin.org"); if (isaTestNet) // Separate UI settings for testnets @@ -206,34 +482,55 @@ int main(int argc, char *argv[]) else QApplication::setApplicationName("Bitcoin-Qt"); + /// 4. Initialization of translations, so that intro dialog is in user's language // Now that QSettings are accessible, initialize translations QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator; initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator); + uiInterface.Translate.connect(Translate); - // Do this early as we don't want to bother initializing if we are just calling IPC - // ... but do it after creating app and setting up translations, so errors are - // translated properly. - if (PaymentServer::ipcSendCommandLine(argc, argv)) - exit(0); - - // Now that translations are initialized check for errors and allow a translatable error message - if (fMissingDatadir) { - QMessageBox::critical(0, QObject::tr("Bitcoin"), - QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); + // Show help message immediately after parsing command-line options (for "-lang") and setting locale, + // but before showing splash screen. + if (mapArgs.count("-?") || mapArgs.count("--help")) + { + HelpMessageDialog help(NULL); + help.showOrPrint(); return 1; } - else if (fSelParFromCLFailed) { + // Now that translations are initialized, check for earlier errors and show a translatable error message + if (fSelParFromCLFailed) { QMessageBox::critical(0, QObject::tr("Bitcoin"), QObject::tr("Error: Invalid combination of -regtest and -testnet.")); return 1; } - // Start up the payment server early, too, so impatient users that click on - // bitcoin: links repeatedly have their payment requests routed to this process: - PaymentServer* paymentServer = new PaymentServer(&app); - + /// 5. Now that settings and translations are available, ask user for data directory // User language is set up: pick a data directory Intro::pickDataDirectory(isaTestNet); + /// 6. Determine availability of data directory and parse bitcoin.conf + if (!boost::filesystem::is_directory(GetDataDir(false))) + { + QMessageBox::critical(0, QObject::tr("Bitcoin"), + QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); + return 1; + } + ReadConfigFile(mapArgs, mapMultiArgs); + +#ifdef ENABLE_WALLET + /// 7. URI IPC sending + // - Do this early as we don't want to bother initializing if we are just calling IPC + // - Do this *after* setting up the data directory, as the data directory hash is used in the name + // of the server. + // - Do this after creating app and setting up translations, so errors are + // translated properly. + if (PaymentServer::ipcSendCommandLine()) + exit(0); + + // Start up the payment server early, too, so impatient users that click on + // bitcoin: links repeatedly have their payment requests routed to this process: + app.createPaymentServer(); +#endif + + /// 8. Main GUI initialization // Install global event filter that makes sure that long tooltips can be word-wrapped app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app)); // Install qDebug() message handler to route to debug.log @@ -242,130 +539,29 @@ int main(int argc, char *argv[]) #else qInstallMessageHandler(DebugMessageHandler); #endif - - // ... now GUI settings: - OptionsModel optionsModel; + // Load GUI settings from QSettings + app.createOptionsModel(); // Subscribe to global signals from core - uiInterface.ThreadSafeMessageBox.connect(ThreadSafeMessageBox); uiInterface.InitMessage.connect(InitMessage); - uiInterface.Translate.connect(Translate); - - // Show help message immediately after parsing command-line options (for "-lang") and setting locale, - // but before showing splash screen. - if (mapArgs.count("-?") || mapArgs.count("--help")) - { - GUIUtil::HelpMessageBox help; - help.showOrPrint(); - return 1; - } - SplashScreen splash(QPixmap(), 0, isaTestNet); if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false)) - { - splash.show(); - splash.setAutoFillBackground(true); - splashref = &splash; - } - - app.processEvents(); - app.setQuitOnLastWindowClosed(false); + app.createSplashScreen(isaTestNet); try { -#ifndef Q_OS_MAC - // Regenerate startup link, to fix links to old versions - // OSX: makes no sense on mac and might also scan/mount external (and sleeping) volumes (can take up some secs) - if (GUIUtil::GetStartOnSystemStartup()) - GUIUtil::SetStartOnSystemStartup(true); -#endif - - boost::thread_group threadGroup; - - BitcoinGUI window(isaTestNet, 0); - guiref = &window; - - QTimer* pollShutdownTimer = new QTimer(guiref); - QObject::connect(pollShutdownTimer, SIGNAL(timeout()), guiref, SLOT(detectShutdown())); - pollShutdownTimer->start(200); - - if(AppInit2(threadGroup)) - { - { - // Put this in a block, so that the Model objects are cleaned up before - // calling Shutdown(). - - optionsModel.Upgrade(); // Must be done after AppInit2 - - PaymentServer::LoadRootCAs(); - paymentServer->setOptionsModel(&optionsModel); - - if (splashref) - splash.finish(&window); - - ClientModel clientModel(&optionsModel); - window.setClientModel(&clientModel); - - WalletModel *walletModel = 0; - if(pwalletMain) - walletModel = new WalletModel(pwalletMain, &optionsModel); - - if(walletModel) - { - window.addWallet("~Default", walletModel); - window.setCurrentWallet("~Default"); - } - - // If -min option passed, start window minimized. - if(GetBoolArg("-min", false)) - { - window.showMinimized(); - } - else - { - window.show(); - } - - // Now that initialization/startup is done, process any command-line - // bitcoin: URIs or payment requests: - QObject::connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), - &window, SLOT(handlePaymentRequest(SendCoinsRecipient))); - QObject::connect(&window, SIGNAL(receivedURI(QString)), - paymentServer, SLOT(handleURIOrFile(QString))); - if(walletModel) - { - QObject::connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)), - paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray))); - } - QObject::connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)), - guiref, SLOT(message(QString,QString,unsigned int))); - QTimer::singleShot(100, paymentServer, SLOT(uiReady())); - - app.exec(); - - window.hide(); - window.setClientModel(0); - window.removeAllWallets(); - guiref = 0; - delete walletModel; - } - // Shutdown the core and its threads, but don't exit the GUI here - threadGroup.interrupt_all(); - threadGroup.join_all(); - Shutdown(); - } - else - { - threadGroup.interrupt_all(); - threadGroup.join_all(); - Shutdown(); - return 1; - } + app.createWindow(isaTestNet); + app.requestInitialize(); + app.exec(); + app.requestShutdown(); + app.exec(); } catch (std::exception& e) { - handleRunawayException(&e); + PrintExceptionContinue(&e, "Runaway exception"); + app.handleRunawayException(QString::fromStdString(strMiscWarning)); } catch (...) { - handleRunawayException(NULL); + PrintExceptionContinue(NULL, "Runaway exception"); + app.handleRunawayException(QString::fromStdString(strMiscWarning)); } - return 0; + return app.getReturnValue(); } #endif // BITCOIN_QT_TEST diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 3c3220c2b3..746b5a4092 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -47,7 +47,41 @@ <file alias="splash_testnet">res/images/splash_testnet.png</file> </qresource> <qresource prefix="/movies"> - <file alias="update_spinner">res/movies/update_spinner.mng</file> + <file alias="spinner-000">res/movies/spinner-000.png</file> + <file alias="spinner-001">res/movies/spinner-001.png</file> + <file alias="spinner-002">res/movies/spinner-002.png</file> + <file alias="spinner-003">res/movies/spinner-003.png</file> + <file alias="spinner-004">res/movies/spinner-004.png</file> + <file alias="spinner-005">res/movies/spinner-005.png</file> + <file alias="spinner-006">res/movies/spinner-006.png</file> + <file alias="spinner-007">res/movies/spinner-007.png</file> + <file alias="spinner-008">res/movies/spinner-008.png</file> + <file alias="spinner-009">res/movies/spinner-009.png</file> + <file alias="spinner-010">res/movies/spinner-010.png</file> + <file alias="spinner-011">res/movies/spinner-011.png</file> + <file alias="spinner-012">res/movies/spinner-012.png</file> + <file alias="spinner-013">res/movies/spinner-013.png</file> + <file alias="spinner-014">res/movies/spinner-014.png</file> + <file alias="spinner-015">res/movies/spinner-015.png</file> + <file alias="spinner-016">res/movies/spinner-016.png</file> + <file alias="spinner-017">res/movies/spinner-017.png</file> + <file alias="spinner-018">res/movies/spinner-018.png</file> + <file alias="spinner-019">res/movies/spinner-019.png</file> + <file alias="spinner-020">res/movies/spinner-020.png</file> + <file alias="spinner-021">res/movies/spinner-021.png</file> + <file alias="spinner-022">res/movies/spinner-022.png</file> + <file alias="spinner-023">res/movies/spinner-023.png</file> + <file alias="spinner-024">res/movies/spinner-024.png</file> + <file alias="spinner-025">res/movies/spinner-025.png</file> + <file alias="spinner-026">res/movies/spinner-026.png</file> + <file alias="spinner-027">res/movies/spinner-027.png</file> + <file alias="spinner-028">res/movies/spinner-028.png</file> + <file alias="spinner-029">res/movies/spinner-029.png</file> + <file alias="spinner-030">res/movies/spinner-030.png</file> + <file alias="spinner-031">res/movies/spinner-031.png</file> + <file alias="spinner-032">res/movies/spinner-032.png</file> + <file alias="spinner-033">res/movies/spinner-033.png</file> + <file alias="spinner-034">res/movies/spinner-034.png</file> </qresource> <qresource prefix="/translations"> <file alias="ach">locale/bitcoin_ach.qm</file> diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 6be5a64015..1008ef2b08 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -4,7 +4,6 @@ #include "bitcoingui.h" -#include "aboutdialog.h" #include "bitcoinunits.h" #include "clientmodel.h" #include "guiconstants.h" @@ -14,8 +13,11 @@ #include "optionsdialog.h" #include "optionsmodel.h" #include "rpcconsole.h" +#include "utilitydialog.h" +#ifdef ENABLE_WALLET #include "walletframe.h" #include "walletmodel.h" +#endif #ifdef Q_OS_MAC #include "macdockiconhandler.h" @@ -37,7 +39,6 @@ #include <QMenuBar> #include <QMessageBox> #include <QMimeData> -#include <QMovie> #include <QProgressBar> #include <QSettings> #include <QStackedWidget> @@ -59,19 +60,34 @@ const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : QMainWindow(parent), clientModel(0), + walletFrame(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), - prevBlocks(0) + prevBlocks(0), + spinnerFrame(0) { GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); + QString windowTitle = tr("Bitcoin Core") + " - "; +#ifdef ENABLE_WALLET + /* if compiled with wallet support, -disablewallet can still disable the wallet */ + bool enableWallet = !GetBoolArg("-disablewallet", false); +#else + bool enableWallet = false; +#endif + if(enableWallet) + { + windowTitle += tr("Wallet"); + } else { + windowTitle += tr("Node"); + } + if (!fIsTestnet) { - setWindowTitle(tr("Bitcoin Core") + " - " + tr("Wallet")); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); @@ -81,7 +97,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : } else { - setWindowTitle(tr("Bitcoin Core") + " - " + tr("Wallet") + " " + tr("[testnet]")); + windowTitle += " " + tr("[testnet]"); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin_testnet")); setWindowIcon(QIcon(":icons/bitcoin_testnet")); @@ -89,6 +105,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet")); #endif } + setWindowTitle(windowTitle); #if defined(Q_OS_MAC) && QT_VERSION < 0x050000 // This property is not implemented in Qt 5. Setting it has no effect. @@ -96,9 +113,21 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : setUnifiedTitleAndToolBarOnMac(true); #endif - // Create wallet frame and make it the central widget - walletFrame = new WalletFrame(this); - setCentralWidget(walletFrame); + rpcConsole = new RPCConsole(enableWallet ? this : 0); +#ifdef ENABLE_WALLET + if(enableWallet) + { + /** Create wallet frame and make it the central widget */ + walletFrame = new WalletFrame(this); + setCentralWidget(walletFrame); + } else +#endif + { + /* When compiled without wallet or -disablewallet is provided, + * the central widget is the rpc console. + */ + setCentralWidget(rpcConsole); + } // Accept D&D of URIs setAcceptDrops(true); @@ -158,10 +187,8 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); - syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); - - rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); + // prevents an oben debug window from becoming stuck/unusable on client shutdown connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); @@ -170,10 +197,16 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : // Initially wallet actions should be disabled setWalletActionsEnabled(false); + + // Subscribe to notifications from core + subscribeToCoreSignals(); } BitcoinGUI::~BitcoinGUI() { + // Unsubscribe from notifications from core + unsubscribeFromCoreSignals(); + GUIUtil::saveWindowGeometry("nWindow", this); if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu) trayIcon->hide(); @@ -267,12 +300,12 @@ void BitcoinGUI::createActions(bool fIsTestnet) openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console")); - usedSendingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Used sending addresses..."), this); + usedSendingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Sending addresses..."), this); usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels")); - usedReceivingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("Used &receiving addresses..."), this); + usedReceivingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Receiving addresses..."), this); usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels")); - openAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_FileIcon), tr("Open URI..."), this); + openAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_FileIcon), tr("Open &URI..."), this); openAction->setStatusTip(tr("Open a bitcoin: URI or payment request")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); @@ -280,14 +313,19 @@ void BitcoinGUI::createActions(bool fIsTestnet) connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); - connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool))); - connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet())); - connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); - connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); - connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); - connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses())); - connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses())); - connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked())); +#ifdef ENABLE_WALLET + if(walletFrame) + { + connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool))); + connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet())); + connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); + connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); + connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); + connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses())); + connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses())); + connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked())); + } +#endif } void BitcoinGUI::createMenuBar() @@ -302,38 +340,50 @@ void BitcoinGUI::createMenuBar() // Configure the menus QMenu *file = appMenuBar->addMenu(tr("&File")); - file->addAction(openAction); - file->addAction(backupWalletAction); - file->addAction(signMessageAction); - file->addAction(verifyMessageAction); - file->addSeparator(); - file->addAction(usedSendingAddressesAction); - file->addAction(usedReceivingAddressesAction); - file->addSeparator(); + if(walletFrame) + { + file->addAction(openAction); + file->addAction(backupWalletAction); + file->addAction(signMessageAction); + file->addAction(verifyMessageAction); + file->addSeparator(); + file->addAction(usedSendingAddressesAction); + file->addAction(usedReceivingAddressesAction); + file->addSeparator(); + } file->addAction(quitAction); QMenu *settings = appMenuBar->addMenu(tr("&Settings")); - settings->addAction(encryptWalletAction); - settings->addAction(changePassphraseAction); - settings->addSeparator(); + if(walletFrame) + { + settings->addAction(encryptWalletAction); + settings->addAction(changePassphraseAction); + settings->addSeparator(); + } settings->addAction(optionsAction); QMenu *help = appMenuBar->addMenu(tr("&Help")); - help->addAction(openRPCConsoleAction); - help->addSeparator(); + if(walletFrame) + { + help->addAction(openRPCConsoleAction); + help->addSeparator(); + } help->addAction(aboutAction); help->addAction(aboutQtAction); } void BitcoinGUI::createToolBars() { - QToolBar *toolbar = addToolBar(tr("Tabs toolbar")); - toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - toolbar->addAction(overviewAction); - toolbar->addAction(sendCoinsAction); - toolbar->addAction(receiveCoinsAction); - toolbar->addAction(historyAction); - overviewAction->setChecked(true); + if(walletFrame) + { + QToolBar *toolbar = addToolBar(tr("Tabs toolbar")); + toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + toolbar->addAction(overviewAction); + toolbar->addAction(sendCoinsAction); + toolbar->addAction(receiveCoinsAction); + toolbar->addAction(historyAction); + overviewAction->setChecked(true); + } } void BitcoinGUI::setClientModel(ClientModel *clientModel) @@ -356,26 +406,39 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int))); rpcConsole->setClientModel(clientModel); - walletFrame->setClientModel(clientModel); +#ifdef ENABLE_WALLET + if(walletFrame) + { + walletFrame->setClientModel(clientModel); + } +#endif } } +#ifdef ENABLE_WALLET bool BitcoinGUI::addWallet(const QString& name, WalletModel *walletModel) { + if(!walletFrame) + return false; setWalletActionsEnabled(true); return walletFrame->addWallet(name, walletModel); } bool BitcoinGUI::setCurrentWallet(const QString& name) { + if(!walletFrame) + return false; return walletFrame->setCurrentWallet(name); } void BitcoinGUI::removeAllWallets() { + if(!walletFrame) + return; setWalletActionsEnabled(false); walletFrame->removeAllWallets(); } +#endif void BitcoinGUI::setWalletActionsEnabled(bool enabled) { @@ -483,6 +546,7 @@ void BitcoinGUI::aboutClicked() dlg.exec(); } +#ifdef ENABLE_WALLET void BitcoinGUI::openClicked() { OpenURIDialog dlg(this); @@ -525,6 +589,7 @@ void BitcoinGUI::gotoVerifyMessageTab(QString addr) { if (walletFrame) walletFrame->gotoVerifyMessageTab(addr); } +#endif void BitcoinGUI::setNumConnections(int count) { @@ -585,7 +650,10 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) tooltip = tr("Up to date") + QString(".<br>") + tooltip; labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); - walletFrame->showOutOfSyncWarning(false); +#ifdef ENABLE_WALLET + if(walletFrame) + walletFrame->showOutOfSyncWarning(false); +#endif progressBarLabel->setVisible(false); progressBar->setVisible(false); @@ -614,12 +682,19 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) progressBar->setVisible(true); tooltip = tr("Catching up...") + QString("<br>") + tooltip; - labelBlocksIcon->setMovie(syncIconMovie); if(count != prevBlocks) - syncIconMovie->jumpToNextFrame(); + { + labelBlocksIcon->setPixmap(QIcon(QString( + ":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0'))) + .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); + spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES; + } prevBlocks = count; - walletFrame->showOutOfSyncWarning(true); +#ifdef ENABLE_WALLET + if(walletFrame) + walletFrame->showOutOfSyncWarning(true); +#endif tooltip += QString("<br>"); tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText); @@ -732,6 +807,7 @@ void BitcoinGUI::closeEvent(QCloseEvent *event) QMainWindow::closeEvent(event); } +#ifdef ENABLE_WALLET void BitcoinGUI::incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address) { // On new transaction, make an info balloon @@ -745,6 +821,7 @@ void BitcoinGUI::incomingTransaction(const QString& date, int unit, qint64 amoun .arg(type) .arg(address), CClientUIInterface::MSG_INFORMATION); } +#endif void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event) { @@ -777,10 +854,11 @@ bool BitcoinGUI::eventFilter(QObject *object, QEvent *event) return QMainWindow::eventFilter(object, event); } +#ifdef ENABLE_WALLET bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient) { // URI has to be valid - if (walletFrame->handlePaymentRequest(recipient)) + if (walletFrame && walletFrame->handlePaymentRequest(recipient)) { showNormalIfMinimized(); gotoSendCoinsPage(); @@ -818,6 +896,7 @@ void BitcoinGUI::setEncryptionStatus(int status) break; } } +#endif void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { @@ -849,5 +928,35 @@ void BitcoinGUI::toggleHidden() void BitcoinGUI::detectShutdown() { if (ShutdownRequested()) - QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection); + { + if(rpcConsole) + rpcConsole->hide(); + qApp->quit(); + } +} + +static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style) +{ + bool modal = (style & CClientUIInterface::MODAL); + bool ret = false; + // In case of modal message, use blocking connection to wait for user to click a button + QMetaObject::invokeMethod(gui, "message", + modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection, + Q_ARG(QString, QString::fromStdString(caption)), + Q_ARG(QString, QString::fromStdString(message)), + Q_ARG(unsigned int, style), + Q_ARG(bool*, &ret)); + return ret; +} + +void BitcoinGUI::subscribeToCoreSignals() +{ + // Connect signals to client + uiInterface.ThreadSafeMessageBox.connect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3)); +} + +void BitcoinGUI::unsubscribeFromCoreSignals() +{ + // Disconnect signals from client + uiInterface.ThreadSafeMessageBox.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3)); } diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 75c61d2a8a..d5bbdca484 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -5,6 +5,10 @@ #ifndef BITCOINGUI_H #define BITCOINGUI_H +#if defined(HAVE_CONFIG_H) +#include "bitcoin-config.h" +#endif + #include <QMainWindow> #include <QMap> #include <QSystemTrayIcon> @@ -43,14 +47,15 @@ public: */ void setClientModel(ClientModel *clientModel); +#ifdef ENABLE_WALLET /** Set the wallet model. The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending functionality. */ bool addWallet(const QString& name, WalletModel *walletModel); bool setCurrentWallet(const QString& name); - void removeAllWallets(); +#endif protected: void changeEvent(QEvent *e); @@ -93,9 +98,9 @@ private: Notificator *notificator; RPCConsole *rpcConsole; - QMovie *syncIconMovie; /** Keep track of previous number of blocks, to detect progress */ int prevBlocks; + int spinnerFrame; /** Create the main UI actions. */ void createActions(bool fIsTestnet); @@ -111,6 +116,11 @@ private: /** Enable or disable all wallet-related actions */ void setWalletActionsEnabled(bool enabled); + /** Connect core signals to GUI client */ + void subscribeToCoreSignals(); + /** Disconnect core signals from GUI client */ + void unsubscribeFromCoreSignals(); + signals: /** Signal raised when a URI was entered or dragged to the GUI */ void receivedURI(const QString &uri); @@ -120,11 +130,6 @@ public slots: void setNumConnections(int count); /** Set number of blocks shown in the UI */ void setNumBlocks(int count, int nTotalBlocks); - /** Set the encryption status as shown in the UI. - @param[in] status current encryption status - @see WalletModel::EncryptionStatus - */ - void setEncryptionStatus(int status); /** Notify the user of an event from the core network or transaction handling code. @param[in] title the message box / notification title @@ -135,12 +140,21 @@ public slots: */ void message(const QString &title, const QString &message, unsigned int style, bool *ret = NULL); +#ifdef ENABLE_WALLET + /** Set the encryption status as shown in the UI. + @param[in] status current encryption status + @see WalletModel::EncryptionStatus + */ + void setEncryptionStatus(int status); + bool handlePaymentRequest(const SendCoinsRecipient& recipient); /** Show incoming transaction notification for new transactions. */ void incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address); +#endif private slots: +#ifdef ENABLE_WALLET /** Switch to overview (home) page */ void gotoOverviewPage(); /** Switch to history (transactions) page */ @@ -155,6 +169,9 @@ private slots: /** Show Sign/Verify Message dialog and switch to verify message tab */ void gotoVerifyMessageTab(QString addr = ""); + /** Show open dialog */ + void openClicked(); +#endif /** Show configuration dialog */ void optionsClicked(); /** Show about dialog */ @@ -163,8 +180,6 @@ private slots: /** Handle tray icon clicked */ void trayIconActivated(QSystemTrayIcon::ActivationReason reason); #endif - /** Show open dialog */ - void openClicked(); /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */ void showNormalIfMinimized(bool fToggleHidden = false); diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 183a98061d..b88c7ec290 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -40,6 +40,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "be solved instantly. This is intended for regression testing tools and app " "development."), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Enter regression test mode, which uses a special chain in which blocks can " +"be solved instantly."), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: The transaction was rejected! This might happen if some of the coins " "in your wallet were already spent, such as if you used a copy of wallet.dat " "and coins were spent in the copy but not marked as spent here."), @@ -119,6 +122,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Connect to JSON-RPC on <port> (default: 8332 QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"), QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"), QT_TRANSLATE_NOOP("bitcoin-core", "Discover own IP address (default: 1 when listening and no -externalip)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Do not load the wallet and disable wallet RPC calls"), QT_TRANSLATE_NOOP("bitcoin-core", "Do you want to rebuild the block database now?"), QT_TRANSLATE_NOOP("bitcoin-core", "Done loading"), QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing block database"), @@ -185,7 +189,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Select SOCKS version for -proxy (4 or 5, defa QT_TRANSLATE_NOOP("bitcoin-core", "Send command to Bitcoin server"), QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"), -QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to debugger"), QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert)"), QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (default: 25)"), @@ -204,6 +207,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"), QT_TRANSLATE_NOOP("bitcoin-core", "Start Bitcoin server"), QT_TRANSLATE_NOOP("bitcoin-core", "System error: "), QT_TRANSLATE_NOOP("bitcoin-core", "This help message"), +QT_TRANSLATE_NOOP("bitcoin-core", "This is intended for regression testing tools and app development."), QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"), QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option"), QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amount too small"), @@ -225,6 +229,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."), QT_TRANSLATE_NOOP("bitcoin-core", "Wait for RPC server to start"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside data directory %s"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin to complete"), +QT_TRANSLATE_NOOP("bitcoin-core", "Wallet options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: Deprecated argument -debugnet ignored, use -debug=net"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"), diff --git a/src/qt/forms/aboutdialog.ui b/src/qt/forms/aboutdialog.ui index 10a5857cab..3ab4675bf3 100644 --- a/src/qt/forms/aboutdialog.ui +++ b/src/qt/forms/aboutdialog.ui @@ -160,12 +160,12 @@ This product includes software developed by the OpenSSL Project for use in the O <slot>accept()</slot> <hints> <hint type="sourcelabel"> - <x>360</x> - <y>308</y> + <x>20</x> + <y>20</y> </hint> <hint type="destinationlabel"> - <x>157</x> - <y>274</y> + <x>20</x> + <y>20</y> </hint> </hints> </connection> @@ -176,12 +176,12 @@ This product includes software developed by the OpenSSL Project for use in the O <slot>reject()</slot> <hints> <hint type="sourcelabel"> - <x>428</x> - <y>308</y> + <x>20</x> + <y>20</y> </hint> <hint type="destinationlabel"> - <x>286</x> - <y>274</y> + <x>20</x> + <y>20</y> </hint> </hints> </connection> diff --git a/src/qt/forms/helpmessagedialog.ui b/src/qt/forms/helpmessagedialog.ui new file mode 100644 index 0000000000..f68fea7e64 --- /dev/null +++ b/src/qt/forms/helpmessagedialog.ui @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>HelpMessageDialog</class> + <widget class="QDialog" name="HelpMessageDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>400</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="windowTitle"> + <string>Bitcoin Core - Command-line options</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="graphic"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Ignored"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="pixmap"> + <pixmap resource="../bitcoin.qrc">:/images/about</pixmap> + </property> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QScrollArea" name="scrollArea"> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOn</enum> + </property> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <widget class="QWidget" name="scrollAreaWidgetContents"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>659</width> + <height>348</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QLabel" name="helpMessageLabel"> + <property name="font"> + <font> + <family>Terminal</family> + </font> + </property> + <property name="cursor"> + <cursorShape>IBeamCursor</cursorShape> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="okButton"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources> + <include location="../bitcoin.qrc"/> + </resources> + <connections> + <connection> + <sender>okButton</sender> + <signal>accepted()</signal> + <receiver>HelpMessageDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel"> + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>okButton</sender> + <signal>rejected()</signal> + <receiver>HelpMessageDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel"> + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 28b629b38c..e0d99aac39 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>540</width> - <height>380</height> + <width>560</width> + <height>400</height> </rect> </property> <property name="windowTitle"> @@ -19,9 +19,6 @@ <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QTabWidget" name="tabWidget"> - <property name="tabPosition"> - <enum>QTabWidget::North</enum> - </property> <property name="currentIndex"> <number>0</number> </property> @@ -87,21 +84,44 @@ </widget> </item> <item> - <spacer name="verticalSpacer_Main"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> <layout class="QHBoxLayout" name="horizontalLayout_2_Main"> <item> + <widget class="QLabel" name="databaseCacheLabel"> + <property name="text"> + <string>Size of &database cache</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="buddy"> + <cstring>databaseCache</cstring> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="databaseCache"> + <property name="toolTip"> + <string>Set database cache size in megabytes (default: 25)</string> + </property> + <property name="maximum"> + <number>1024</number> + </property> + <property name="value"> + <number>25</number> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="databaseCacheUnitLabel"> + <property name="text"> + <string>MB</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + </widget> + </item> + <item> <spacer name="horizontalSpacer_2_Main"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -114,21 +134,64 @@ </property> </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3_Main"> + <item> + <widget class="QLabel" name="threadsScriptVerifLabel"> + <property name="text"> + <string>Number of script &verification threads</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="buddy"> + <cstring>threadsScriptVerif</cstring> + </property> + </widget> + </item> <item> - <widget class="QPushButton" name="resetButton"> + <widget class="QSpinBox" name="threadsScriptVerif"> <property name="toolTip"> - <string>Reset all client options to default.</string> + <string>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</string> </property> - <property name="text"> - <string>&Reset Options</string> + <property name="minimum"> + <number>-16</number> </property> - <property name="autoDefault"> - <bool>false</bool> + <property name="maximum"> + <number>16</number> </property> </widget> </item> + <item> + <spacer name="horizontalSpacer_3_Main"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> </layout> </item> + <item> + <spacer name="verticalSpacer_Main"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <widget class="QWidget" name="tabNetwork"> @@ -149,15 +212,15 @@ <item> <widget class="QCheckBox" name="connectSocks"> <property name="toolTip"> - <string>Connect to the Bitcoin network through a SOCKS proxy (e.g. when connecting through Tor).</string> + <string>Connect to the Bitcoin network through a SOCKS proxy.</string> </property> <property name="text"> - <string>&Connect through SOCKS proxy:</string> + <string>&Connect through SOCKS proxy (default proxy):</string> </property> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_Network"> + <layout class="QHBoxLayout" name="horizontalLayout_1_Network"> <item> <widget class="QLabel" name="proxyIpLabel"> <property name="text"> @@ -173,6 +236,12 @@ </item> <item> <widget class="QValidatedLineEdit" name="proxyIp"> + <property name="minimumSize"> + <size> + <width>140</width> + <height>0</height> + </size> + </property> <property name="maximumSize"> <size> <width>140</width> @@ -180,7 +249,7 @@ </size> </property> <property name="toolTip"> - <string>IP address of the proxy (e.g. 127.0.0.1)</string> + <string>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</string> </property> </widget> </item> @@ -199,6 +268,12 @@ </item> <item> <widget class="QLineEdit" name="proxyPort"> + <property name="minimumSize"> + <size> + <width>55</width> + <height>0</height> + </size> + </property> <property name="maximumSize"> <size> <width>55</width> @@ -231,7 +306,7 @@ </widget> </item> <item> - <spacer name="horizontalSpacer_Network"> + <spacer name="horizontalSpacer_1_Network"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -391,8 +466,67 @@ </widget> </item> <item> + <widget class="QFrame" name="frame"> + <layout class="QVBoxLayout" name="verticalLayout_Bottom"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_Bottom"> + <item> + <widget class="QLabel" name="overriddenByCommandLineInfoLabel"> + <property name="text"> + <string>Active command-line options that override above options:</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_Bottom"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="overriddenByCommandLineLabel"> + <property name="text"> + <string/> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <layout class="QHBoxLayout" name="horizontalLayout_Buttons"> <item> + <widget class="QPushButton" name="resetButton"> + <property name="toolTip"> + <string>Reset all client options to default.</string> + </property> + <property name="text"> + <string>&Reset Options</string> + </property> + <property name="autoDefault"> + <bool>false</bool> + </property> + </widget> + </item> + <item> <spacer name="horizontalSpacer_1"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -407,6 +541,12 @@ </item> <item> <widget class="QLabel" name="statusLabel"> + <property name="minimumSize"> + <size> + <width>200</width> + <height>0</height> + </size> + </property> <property name="font"> <font> <weight>75</weight> @@ -454,16 +594,6 @@ </property> </widget> </item> - <item> - <widget class="QPushButton" name="applyButton"> - <property name="text"> - <string>&Apply</string> - </property> - <property name="autoDefault"> - <bool>false</bool> - </property> - </widget> - </item> </layout> </item> </layout> @@ -473,17 +603,18 @@ <class>BitcoinAmountField</class> <extends>QLineEdit</extends> <header>bitcoinamountfield.h</header> - </customwidget> - <customwidget> - <class>QValueComboBox</class> - <extends>QComboBox</extends> - <header>qvaluecombobox.h</header> + <container>1</container> </customwidget> <customwidget> <class>QValidatedLineEdit</class> <extends>QLineEdit</extends> <header>qvalidatedlineedit.h</header> </customwidget> + <customwidget> + <class>QValueComboBox</class> + <extends>QComboBox</extends> + <header>qvaluecombobox.h</header> + </customwidget> </customwidgets> <resources/> <connections/> diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index 9d0d838daa..d1ca969431 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -90,6 +90,8 @@ </layout> </item> <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> <layout class="QFormLayout" name="formLayout_2"> <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> @@ -234,6 +236,21 @@ </item> </layout> </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </widget> </item> diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui index e7138f5371..8242763e77 100644 --- a/src/qt/forms/receivecoinsdialog.ui +++ b/src/qt/forms/receivecoinsdialog.ui @@ -202,7 +202,7 @@ </font> </property> <property name="text"> - <string>Previously requested payments</string> + <string>Requested payments</string> </property> </widget> </item> diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 6c9fa6a755..d1a601706b 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -38,4 +38,7 @@ static const int MAX_PAYMENT_REQUEST_SIZE = 50000; // bytes /* QRCodeDialog -- size of exported QR Code image */ #define EXPORT_IMAGE_SIZE 256 +/* Number of frames in spinner animation */ +#define SPINNER_FRAMES 35 + #endif // GUICONSTANTS_H diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index b87498402d..2d8a6afe21 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -591,47 +591,6 @@ void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize, parent->move(pos); } -HelpMessageBox::HelpMessageBox(QWidget *parent) : - QMessageBox(parent) -{ - header = tr("Bitcoin Core") + " " + tr("version") + " " + - QString::fromStdString(FormatFullVersion()) + "\n\n" + - tr("Usage:") + "\n" + - " bitcoin-qt [" + tr("command-line options") + "] " + "\n"; - - coreOptions = QString::fromStdString(HelpMessage(HMM_BITCOIN_QT)); - - uiOptions = tr("UI options") + ":\n" + - " -lang=<lang> " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" + - " -min " + tr("Start minimized") + "\n" + - " -splash " + tr("Show splash screen on startup (default: 1)") + "\n" + - " -choosedatadir " + tr("Choose data directory on startup (default: 0)") + "\n"; - - setWindowTitle(tr("Bitcoin Core")); - setTextFormat(Qt::PlainText); - // setMinimumWidth is ignored for QMessageBox so put in non-breaking spaces to make it wider. - setText(header + QString(QChar(0x2003)).repeated(50)); - setDetailedText(coreOptions + "\n" + uiOptions); -} - -void HelpMessageBox::printToConsole() -{ - // On other operating systems, the expected action is to print the message to the console. - QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions; - fprintf(stdout, "%s", strUsage.toStdString().c_str()); -} - -void HelpMessageBox::showOrPrint() -{ -#if defined(WIN32) - // On Windows, show a message box, as there is no stderr/stdout in windowed applications - exec(); -#else - // On other operating systems, print help text to console - printToConsole(); -#endif -} - void setClipboard(const QString& str) { QApplication::clipboard()->setText(str, QClipboard::Clipboard); diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 14d4ff17c1..c894850a91 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -123,26 +123,6 @@ namespace GUIUtil /** Restore window size and position */ void restoreWindowGeometry(const QString& strSetting, const QSize &defaultSizeIn, QWidget *parent); - /** Help message for Bitcoin-Qt, shown with --help. */ - class HelpMessageBox : public QMessageBox - { - Q_OBJECT - - public: - HelpMessageBox(QWidget *parent = 0); - - /** Show message box or print help message to standard output, based on operating system. */ - void showOrPrint(); - - /** Print help message to console */ - void printToConsole(); - - private: - QString header; - QString coreOptions; - QString uiOptions; - }; - } // namespace GUIUtil #endif // GUIUTIL_H diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 3ecd96cc42..453bbdf374 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -148,7 +148,7 @@ QString Intro::getDefaultDataDirectory() void Intro::pickDataDirectory(bool fIsTestnet) { - namespace fs = boost::filesystem;; + namespace fs = boost::filesystem; QSettings settings; /* If data directory provided on command line, no need to look at settings or show a picking dialog */ @@ -233,7 +233,7 @@ void Intro::on_dataDirectory_textChanged(const QString &dataDirStr) void Intro::on_ellipsisButton_clicked() { - QString dir = QFileDialog::getExistingDirectory(0, "Choose data directory", ui->dataDirectory->text()); + QString dir = QDir::toNativeSeparators(QFileDialog::getExistingDirectory(0, "Choose data directory", ui->dataDirectory->text())); if(!dir.isEmpty()) ui->dataDirectory->setText(dir); } diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 368a4d6003..f52544687b 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -322,24 +322,43 @@ This product includes software developed by the OpenSSL Project for use in the O </message> </context> <context> + <name>BitcoinApplication</name> + <message> + <location filename="../bitcoin.cpp" line="+362"/> + <source>Bitcoin Core is shutting down... +</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Do not shut down the computer until this window disappears.</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>BitcoinGUI</name> <message> - <location filename="../bitcoingui.cpp" line="+260"/> + <location filename="../bitcoingui.cpp" line="+297"/> <source>Sign &message...</source> <translation>Sign &message...</translation> </message> <message> - <location line="+290"/> + <location line="+323"/> <source>Synchronizing with network...</source> <translation>Synchronizing with network...</translation> </message> <message> - <location line="-360"/> + <location line="-395"/> <source>&Overview</source> <translation>&Overview</translation> </message> <message> - <location line="+1"/> + <location line="-139"/> + <source>Node</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+140"/> <source>Show general overview of wallet</source> <translation>Show general overview of wallet</translation> </message> @@ -354,7 +373,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Browse transaction history</translation> </message> <message> - <location line="+15"/> + <location line="+17"/> <source>E&xit</source> <translation>E&xit</translation> </message> @@ -400,7 +419,22 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Change Passphrase...</translation> </message> <message> - <location line="+295"/> + <location line="+10"/> + <source>&Sending addresses...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>&Receiving addresses...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Open &URI...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+313"/> <source>Importing blocks from disk...</source> <translation>Importing blocks from disk...</translation> </message> @@ -410,12 +444,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Reindexing blocks on disk...</translation> </message> <message> - <location line="-358"/> + <location line="-393"/> <source>Send coins to a Bitcoin address</source> <translation>Send coins to a Bitcoin address</translation> </message> <message> - <location line="+47"/> + <location line="+49"/> <source>Modify configuration options for Bitcoin</source> <translation>Modify configuration options for Bitcoin</translation> </message> @@ -445,18 +479,17 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Verify message...</translation> </message> <message> - <location line="+375"/> + <location line="+414"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> - <location line="-563"/> - <location line="+10"/> + <location line="-629"/> <source>Wallet</source> <translation>Wallet</translation> </message> <message> - <location line="+113"/> + <location line="+148"/> <source>&Send</source> <translation>&Send</translation> </message> @@ -466,7 +499,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Receive</translation> </message> <message> - <location line="+44"/> + <location line="+46"/> <location line="+2"/> <source>&Show / Hide</source> <translation>&Show / Hide</translation> @@ -492,86 +525,70 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation> </message> <message> - <location line="+39"/> + <location line="+44"/> <source>&File</source> <translation>&File</translation> </message> <message> - <location line="+11"/> + <location line="+14"/> <source>&Settings</source> <translation>&Settings</translation> </message> <message> - <location line="+6"/> + <location line="+9"/> <source>&Help</source> <translation>&Help</translation> </message> <message> - <location line="+9"/> + <location line="+14"/> <source>Tabs toolbar</source> <translation>Tabs toolbar</translation> </message> <message> - <location line="-244"/> - <location line="+321"/> + <location line="-281"/> + <location line="+373"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> - <location line="-331"/> - <location line="+10"/> + <location line="-398"/> <source>Bitcoin Core</source> <translation type="unfinished">Bitcoin Core</translation> </message> <message> - <location line="+121"/> + <location line="+165"/> <source>Request payments (generates QR codes and bitcoin: URIs)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+27"/> + <location line="+29"/> <location line="+2"/> <source>&About Bitcoin Core</source> <translation type="unfinished"></translation> </message> <message> - <location line="+34"/> - <source>&Used sending addresses...</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> + <location line="+35"/> <source>Show the list of used sending addresses and labels</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Used &receiving addresses...</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Show the list of used receiving addresses and labels</source> - <translation type="unfinished"></translation> - </message> - <message> <location line="+2"/> - <source>Open URI...</source> + <source>Show the list of used receiving addresses and labels</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="+3"/> <source>Open a bitcoin: URI or payment request</source> <translation type="unfinished"></translation> </message> <message> - <location line="+126"/> + <location line="+157"/> <location line="+5"/> <source>Bitcoin client</source> <translation>Bitcoin client</translation> </message> <message numerus="yes"> - <location line="+133"/> + <location line="+135"/> <source>%n active connection(s) to Bitcoin network</source> <translation> <numerusform>%n active connection to Bitcoin network</numerusform> @@ -594,7 +611,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Processed %1 blocks of transaction history.</translation> </message> <message numerus="yes"> - <location line="+20"/> + <location line="+23"/> <source>%n hour(s)</source> <translation> <numerusform>%n hour</numerusform> @@ -623,7 +640,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>%1 behind</translation> </message> <message> - <location line="+14"/> + <location line="+17"/> <source>Last received block was generated %1 ago.</source> <translation>Last received block was generated %1 ago.</translation> </message> @@ -648,27 +665,17 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Information</translation> </message> <message> - <location line="+77"/> - <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> - <translation>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</translation> - </message> - <message> - <location line="-152"/> + <location line="-81"/> <source>Up to date</source> <translation>Up to date</translation> </message> <message> - <location line="+31"/> + <location line="+34"/> <source>Catching up...</source> <translation>Catching up...</translation> </message> <message> - <location line="+124"/> - <source>Confirm transaction fee</source> - <translation>Confirm transaction fee</translation> - </message> - <message> - <location line="+8"/> + <location line="+126"/> <source>Sent transaction</source> <translation>Sent transaction</translation> </message> @@ -691,7 +698,7 @@ Address: %4 </translation> </message> <message> - <location line="+67"/> + <location line="+69"/> <source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source> <translation>Wallet is <b>encrypted</b> and currently <b>unlocked</b></translation> </message> @@ -701,7 +708,7 @@ Address: %4 <translation>Wallet is <b>encrypted</b> and currently <b>locked</b></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+116"/> + <location filename="../bitcoin.cpp" line="+78"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</translation> </message> @@ -923,7 +930,12 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="+171"/> + <location line="+31"/> + <source>none</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+140"/> <source>Dust</source> <translation type="unfinished"></translation> </message> @@ -960,7 +972,7 @@ Address: %4 </message> <message> <location line="+1"/> - <source>This label turns red, if the priority is smaller than "medium"</source> + <source>This label turns red, if the priority is smaller than "medium".</source> <translation type="unfinished"></translation> </message> <message> @@ -1029,7 +1041,7 @@ Address: %4 <translation>&Address</translation> </message> <message> - <location filename="../editaddressdialog.cpp" line="+25"/> + <location filename="../editaddressdialog.cpp" line="+28"/> <source>New receiving address</source> <translation>New receiving address</translation> </message> @@ -1240,7 +1252,7 @@ Address: %4 <translation>Options</translation> </message> <message> - <location line="+16"/> + <location line="+13"/> <source>&Main</source> <translation>&Main</translation> </message> @@ -1265,7 +1277,47 @@ Address: %4 <translation>&Start Bitcoin on system login</translation> </message> <message> - <location line="+35"/> + <location line="+9"/> + <source>Size of &database cache</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Set database cache size in megabytes (default: 25)</source> + <translation type="unfinished">Set database cache size in megabytes (default: 25)</translation> + </message> + <message> + <location line="+13"/> + <source>MB</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+27"/> + <source>Number of script &verification threads</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source> + <translation type="unfinished">Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</translation> + </message> + <message> + <location line="+58"/> + <source>Connect to the Bitcoin network through a SOCKS proxy.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>&Connect through SOCKS proxy (default proxy):</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+34"/> + <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+267"/> <source>Reset all client options to default.</source> <translation>Reset all client options to default.</translation> </message> @@ -1275,7 +1327,7 @@ Address: %4 <translation>&Reset Options</translation> </message> <message> - <location line="+13"/> + <location line="-323"/> <source>&Network</source> <translation>&Network</translation> </message> @@ -1290,32 +1342,17 @@ Address: %4 <translation>Map port using &UPnP</translation> </message> <message> - <location line="+7"/> - <source>Connect to the Bitcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> - <translation>Connect to the Bitcoin network through a SOCKS proxy (e.g. when connecting through Tor).</translation> - </message> - <message> - <location line="+3"/> - <source>&Connect through SOCKS proxy:</source> - <translation>&Connect through SOCKS proxy:</translation> - </message> - <message> - <location line="+9"/> + <location line="+19"/> <source>Proxy &IP:</source> <translation>Proxy &IP:</translation> </message> <message> - <location line="+19"/> - <source>IP address of the proxy (e.g. 127.0.0.1)</source> - <translation>IP address of the proxy (e.g. 127.0.0.1)</translation> - </message> - <message> - <location line="+7"/> + <location line="+32"/> <source>&Port:</source> <translation>&Port:</translation> </message> <message> - <location line="+19"/> + <location line="+25"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port of the proxy (e.g. 9050)</translation> </message> @@ -1400,7 +1437,12 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="+71"/> + <location line="+29"/> + <source>Active command-line options that override above options: </source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+107"/> <source>&OK</source> <translation>&OK</translation> </message> @@ -1410,44 +1452,38 @@ Address: %4 <translation>&Cancel</translation> </message> <message> - <location line="+10"/> - <source>&Apply</source> - <translation>&Apply</translation> - </message> - <message> - <location filename="../optionsdialog.cpp" line="+63"/> + <location filename="../optionsdialog.cpp" line="+68"/> <source>default</source> <translation>default</translation> </message> <message> - <location line="+131"/> + <location line="+57"/> + <source>none</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+75"/> <source>Confirm options reset</source> <translation>Confirm options reset</translation> </message> <message> <location line="+1"/> - <source>Some settings may require a client restart to take effect.</source> - <translation>Some settings may require a client restart to take effect.</translation> - </message> - <message> - <location line="+0"/> - <source>Do you want to proceed?</source> - <translation>Do you want to proceed?</translation> + <location line="+29"/> + <source>Client restart required to activate changes.</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+42"/> - <location line="+9"/> - <source>Warning</source> - <translation>Warning</translation> + <location line="-29"/> + <source>Client will be shutdown, do you want to proceed?</source> + <translation type="unfinished"></translation> </message> <message> - <location line="-9"/> - <location line="+9"/> - <source>This setting will take effect after restarting Bitcoin.</source> - <translation>This setting will take effect after restarting Bitcoin.</translation> + <location line="+33"/> + <source>This change would require a client restart.</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+29"/> + <location line="+34"/> <source>The supplied proxy address is invalid.</source> <translation>The supplied proxy address is invalid.</translation> </message> @@ -1461,22 +1497,22 @@ Address: %4 </message> <message> <location line="+50"/> - <location line="+214"/> + <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source> <translation>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</translation> </message> <message> - <location line="-140"/> + <location line="-155"/> <source>Unconfirmed:</source> <translation>Unconfirmed:</translation> </message> <message> - <location line="-81"/> + <location line="-83"/> <source>Wallet</source> <translation>Wallet</translation> </message> <message> - <location line="+49"/> + <location line="+51"/> <source>Confirmed:</source> <translation>Confirmed:</translation> </message> @@ -1511,7 +1547,7 @@ Address: %4 <translation>Your current total balance</translation> </message> <message> - <location line="+56"/> + <location line="+71"/> <source><b>Recent transactions</b></source> <translation><b>Recent transactions</b></translation> </message> @@ -1525,7 +1561,8 @@ Address: %4 <context> <name>PaymentServer</name> <message> - <location filename="../paymentserver.cpp" line="+397"/> + <location filename="../paymentserver.cpp" line="+400"/> + <location line="+13"/> <source>URI handling</source> <translation type="unfinished">URI handling</translation> </message> @@ -1535,24 +1572,42 @@ Address: %4 <translation type="unfinished">URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</translation> </message> <message> - <location line="+91"/> + <location line="+96"/> <source>Requested payment amount of %1 is too small (considered dust).</source> <translation type="unfinished"></translation> </message> <message> - <location line="-204"/> - <location line="+195"/> + <location line="-216"/> + <location line="+207"/> <location line="+13"/> + <location line="+95"/> + <location line="+18"/> + <location line="+16"/> <source>Payment request error</source> <translation type="unfinished"></translation> </message> <message> - <location line="-207"/> + <location line="-348"/> <source>Cannot start bitcoin: click-to-pay handler</source> <translation type="unfinished"></translation> </message> <message> - <location line="+195"/> + <location line="+106"/> + <source>Payment request fetch URL is invalid: %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+27"/> + <source>Payment request file handling</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Payment request file can not be read or processed! This can be caused by an invalid payment request file.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+73"/> <source>Unverified payment requests to custom payment scripts are unsupported.</source> <translation type="unfinished"></translation> </message> @@ -1562,24 +1617,27 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="+42"/> + <location line="+43"/> <source>Error communicating with %1: %2</source> <translation type="unfinished"></translation> </message> <message> - <location line="+28"/> + <location line="+24"/> + <source>Payment request can not be parsed or processed!</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+11"/> <source>Bad response from server %1</source> <translation type="unfinished"></translation> </message> <message> - <location line="+32"/> + <location line="+33"/> <source>Payment acknowledged</source> <translation type="unfinished"></translation> </message> <message> - <location line="-55"/> - <location line="+27"/> - <location line="+17"/> + <location line="-11"/> <source>Network request error</source> <translation type="unfinished"></translation> </message> @@ -1587,18 +1645,18 @@ Address: %4 <context> <name>QObject</name> <message> - <location filename="../bitcoin.cpp" line="+119"/> - <location line="+5"/> + <location filename="../bitcoin.cpp" line="+71"/> + <location line="+11"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> - <location line="-4"/> + <location line="+1"/> <source>Error: Specified data directory "%1" does not exist.</source> <translation>Error: Specified data directory "%1" does not exist.</translation> </message> <message> - <location line="+4"/> + <location line="-12"/> <source>Error: Invalid combination of -regtest and -testnet.</source> <translation type="unfinished"></translation> </message> @@ -1640,7 +1698,8 @@ Address: %4 <location line="+23"/> <location line="+23"/> <location line="+36"/> - <location line="+53"/> + <location line="+23"/> + <location line="+36"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+360"/> @@ -1648,7 +1707,7 @@ Address: %4 <translation>N/A</translation> </message> <message> - <location line="-217"/> + <location line="-223"/> <source>Client version</source> <translation>Client version</translation> </message> @@ -1663,7 +1722,12 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="+78"/> + <location line="+25"/> + <source>General</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+53"/> <source>Using OpenSSL version</source> <translation>Using OpenSSL version</translation> </message> @@ -1679,16 +1743,16 @@ Address: %4 </message> <message> <location line="+7"/> - <source>Number of connections</source> - <translation>Number of connections</translation> + <source>Name</source> + <translation type="unfinished"></translation> </message> <message> <location line="+23"/> - <source>On testnet</source> - <translation>On testnet</translation> + <source>Number of connections</source> + <translation>Number of connections</translation> </message> <message> - <location line="+23"/> + <location line="+29"/> <source>Block chain</source> <translation>Block chain</translation> </message> @@ -1753,17 +1817,12 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="-541"/> + <location line="-547"/> <source>Build date</source> <translation>Build date</translation> </message> <message> - <location line="-79"/> - <source>Bitcoin Core</source> - <translation>Bitcoin Core</translation> - </message> - <message> - <location line="+279"/> + <location line="+206"/> <source>Debug log file</source> <translation>Debug log file</translation> </message> @@ -1897,7 +1956,7 @@ Address: %4 </message> <message> <location line="+47"/> - <source>Previously requested payments</source> + <source>Requested payments</source> <translation type="unfinished"></translation> </message> <message> @@ -1992,7 +2051,7 @@ Address: %4 <context> <name>RecentRequestsTableModel</name> <message> - <location filename="../recentrequeststablemodel.cpp" line="+14"/> + <location filename="../recentrequeststablemodel.cpp" line="+17"/> <source>Date</source> <translation type="unfinished">Date</translation> </message> @@ -2012,7 +2071,7 @@ Address: %4 <translation type="unfinished">Amount</translation> </message> <message> - <location line="+36"/> + <location line="+38"/> <source>(no label)</source> <translation type="unfinished">(no label)</translation> </message> @@ -2027,7 +2086,7 @@ Address: %4 <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+381"/> - <location line="+81"/> + <location line="+80"/> <source>Send Coins</source> <translation>Send Coins</translation> </message> @@ -2137,7 +2196,7 @@ Address: %4 <translation>S&end</translation> </message> <message> - <location filename="../sendcoinsdialog.cpp" line="-229"/> + <location filename="../sendcoinsdialog.cpp" line="-228"/> <source>Confirm send coins</source> <translation>Confirm send coins</translation> </message> @@ -2240,22 +2299,22 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="+113"/> + <location line="+112"/> <source>Warning: Invalid Bitcoin address</source> <translation type="unfinished"></translation> </message> <message> - <location line="+13"/> + <location line="+21"/> <source>(no label)</source> <translation type="unfinished">(no label)</translation> </message> <message> - <location line="+8"/> + <location line="-11"/> <source>Warning: Unknown change address</source> <translation type="unfinished"></translation> </message> <message> - <location line="-378"/> + <location line="-366"/> <source>Are you sure you want to send?</source> <translation type="unfinished"></translation> </message> @@ -2565,7 +2624,7 @@ Address: %4 <context> <name>SplashScreen</name> <message> - <location filename="../splashscreen.cpp" line="+26"/> + <location filename="../splashscreen.cpp" line="+28"/> <source>Bitcoin Core</source> <translation type="unfinished">Bitcoin Core</translation> </message> @@ -2811,8 +2870,13 @@ Address: %4 <source>Amount</source> <translation>Amount</translation> </message> + <message> + <location line="+59"/> + <source>Immature (%1 confirmations, will be available after %2)</source> + <translation type="unfinished"></translation> + </message> <message numerus="yes"> - <location line="+57"/> + <location line="+16"/> <source>Open for %n more block(s)</source> <translation> <numerusform>Open for %n more block</numerusform> @@ -2835,20 +2899,13 @@ Address: %4 <translation>Unconfirmed (%1 of %2 confirmations)</translation> </message> <message> - <location line="+3"/> + <location line="-22"/> + <location line="+25"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmed (%1 confirmations)</translation> </message> - <message numerus="yes"> - <location line="+8"/> - <source>Mined balance will be available when it matures in %n more block(s)</source> - <translation> - <numerusform>Mined balance will be available when it matures in %n more block</numerusform> - <numerusform>Mined balance will be available when it matures in %n more blocks</numerusform> - </translation> - </message> <message> - <location line="+5"/> + <location line="-22"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>This block was not received by any other nodes and will probably not be accepted!</translation> </message> @@ -2858,7 +2915,7 @@ Address: %4 <translation>Generated but not accepted</translation> </message> <message> - <location line="+43"/> + <location line="+62"/> <source>Received with</source> <translation>Received with</translation> </message> @@ -3154,7 +3211,7 @@ Address: %4 <context> <name>bitcoin-core</name> <message> - <location filename="../bitcoinstrings.cpp" line="+217"/> + <location filename="../bitcoinstrings.cpp" line="+221"/> <source>Usage:</source> <translation>Usage:</translation> </message> @@ -3174,7 +3231,7 @@ Address: %4 <translation>Options:</translation> </message> <message> - <location line="+23"/> + <location line="+22"/> <source>Specify configuration file (default: bitcoin.conf)</source> <translation>Specify configuration file (default: bitcoin.conf)</translation> </message> @@ -3194,7 +3251,7 @@ Address: %4 <translation>Set database cache size in megabytes (default: 25)</translation> </message> <message> - <location line="-27"/> + <location line="-26"/> <source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source> <translation>Listen for connections on <port> (default: 8333 or testnet: 18333)</translation> </message> @@ -3204,7 +3261,7 @@ Address: %4 <translation>Maintain at most <n> connections to peers (default: 125)</translation> </message> <message> - <location line="-50"/> + <location line="-51"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Connect to a node to retrieve peer addresses, and disconnect</translation> </message> @@ -3214,22 +3271,22 @@ Address: %4 <translation>Specify your own public address</translation> </message> <message> - <location line="+4"/> + <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Threshold for disconnecting misbehaving peers (default: 100)</translation> </message> <message> - <location line="-147"/> + <location line="-148"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</translation> </message> <message> - <location line="-33"/> + <location line="-36"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>An error occurred while setting up the RPC port %u for listening on IPv4: %s</translation> </message> <message> - <location line="+31"/> + <location line="+34"/> <source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source> <translation>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</translation> </message> @@ -3239,7 +3296,7 @@ Address: %4 <translation>Accept command line and JSON-RPC commands</translation> </message> <message> - <location line="+79"/> + <location line="+80"/> <source>Run in the background as a daemon and accept commands</source> <translation>Run in the background as a daemon and accept commands</translation> </message> @@ -3249,12 +3306,12 @@ Address: %4 <translation>Use the test network</translation> </message> <message> - <location line="-117"/> + <location line="-118"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accept connections from outside (default: 1 if no -proxy or -connect)</translation> </message> <message> - <location line="-92"/> + <location line="-95"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: @@ -3305,6 +3362,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. </message> <message> <location line="+4"/> + <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</translation> </message> @@ -3410,6 +3472,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. </message> <message> <location line="+1"/> + <source>Do not load the wallet and disable wallet RPC calls</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Do you want to rebuild the block database now?</translation> </message> @@ -3574,7 +3641,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation type="unfinished"></translation> </message> <message> - <location line="+8"/> + <location line="+7"/> <source>Set maximum block size in bytes (default: %d)</source> <translation type="unfinished"></translation> </message> @@ -3594,7 +3661,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation type="unfinished"></translation> </message> <message> - <location line="+12"/> + <location line="+3"/> + <source>This is intended for regression testing tools and app development.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> <source>Usage (deprecated, use bitcoin-cli):</source> <translation type="unfinished"></translation> </message> @@ -3619,7 +3691,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Wallet %s resides outside data directory %s</translation> </message> <message> - <location line="+3"/> + <location line="+2"/> + <source>Wallet options:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation type="unfinished"></translation> </message> @@ -3629,12 +3706,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>You need to rebuild the database using -reindex to change -txindex</translation> </message> <message> - <location line="-78"/> + <location line="-79"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Imports blocks from external blk000??.dat file</translation> </message> <message> - <location line="-104"/> + <location line="-105"/> <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> <translation>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</translation> </message> @@ -3654,7 +3731,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</translation> </message> <message> - <location line="+88"/> + <location line="+89"/> <source>Information</source> <translation>Information</translation> </message> @@ -3704,11 +3781,6 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Send trace/debug info to console instead of debug.log file</translation> </message> <message> - <location line="+1"/> - <source>Send trace/debug info to debugger</source> - <translation>Send trace/debug info to debugger</translation> - </message> - <message> <location line="+6"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Set minimum block size in bytes (default: 0)</translation> @@ -3734,7 +3806,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>System error: </translation> </message> <message> - <location line="+4"/> + <location line="+5"/> <source>Transaction amount too small</source> <translation>Transaction amount too small</translation> </message> @@ -3764,7 +3836,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Username for JSON-RPC connections</translation> </message> <message> - <location line="+6"/> + <location line="+7"/> <source>Warning</source> <translation>Warning</translation> </message> @@ -3784,37 +3856,37 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>wallet.dat corrupt, salvage failed</translation> </message> <message> - <location line="-57"/> + <location line="-58"/> <source>Password for JSON-RPC connections</source> <translation>Password for JSON-RPC connections</translation> </message> <message> - <location line="-69"/> + <location line="-70"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Allow JSON-RPC connections from specified IP address</translation> </message> <message> - <location line="+79"/> + <location line="+80"/> <source>Send commands to node running on <ip> (default: 127.0.0.1)</source> <translation>Send commands to node running on <ip> (default: 127.0.0.1)</translation> </message> <message> - <location line="-131"/> + <location line="-132"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation> </message> <message> - <location line="+160"/> + <location line="+161"/> <source>Upgrade wallet to latest format</source> <translation>Upgrade wallet to latest format</translation> </message> <message> - <location line="-23"/> + <location line="-24"/> <source>Set key pool size to <n> (default: 100)</source> <translation>Set key pool size to <n> (default: 100)</translation> </message> <message> - <location line="-12"/> + <location line="-11"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Rescan the block chain for missing wallet transactions</translation> </message> @@ -3824,7 +3896,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Use OpenSSL (https) for JSON-RPC connections</translation> </message> <message> - <location line="-29"/> + <location line="-30"/> <source>Server certificate file (default: server.cert)</source> <translation>Server certificate file (default: server.cert)</translation> </message> @@ -3839,17 +3911,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>This help message</translation> </message> <message> - <location line="+6"/> + <location line="+7"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Unable to bind to %s on this computer (bind returned error %d, %s)</translation> </message> <message> - <location line="-106"/> + <location line="-107"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation> </message> <message> - <location line="+59"/> + <location line="+60"/> <source>Loading addresses...</source> <translation>Loading addresses...</translation> </message> @@ -3889,7 +3961,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Unknown -socks proxy version requested: %i</translation> </message> <message> - <location line="-100"/> + <location line="-101"/> <source>Cannot resolve -bind address: '%s'</source> <translation>Cannot resolve -bind address: '%s'</translation> </message> @@ -3899,7 +3971,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Cannot resolve -externalip address: '%s'</translation> </message> <message> - <location line="+47"/> + <location line="+48"/> <source>Invalid amount for -paytxfee=<amount>: '%s'</source> <translation>Invalid amount for -paytxfee=<amount>: '%s'</translation> </message> @@ -3919,7 +3991,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Loading block index...</translation> </message> <message> - <location line="-61"/> + <location line="-62"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Add a node to connect to and attempt to keep the connection open</translation> </message> @@ -3929,12 +4001,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Unable to bind to %s on this computer. Bitcoin is probably already running.</translation> </message> <message> - <location line="+94"/> + <location line="+95"/> <source>Loading wallet...</source> <translation>Loading wallet...</translation> </message> <message> - <location line="-55"/> + <location line="-56"/> <source>Cannot downgrade wallet</source> <translation>Cannot downgrade wallet</translation> </message> @@ -3944,7 +4016,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Cannot write default address</translation> </message> <message> - <location line="+66"/> + <location line="+67"/> <source>Rescanning...</source> <translation>Rescanning...</translation> </message> @@ -3964,7 +4036,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Error</translation> </message> <message> - <location line="-34"/> + <location line="-35"/> <source>You must set rpcpassword=<password> in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp index 1cef397d12..38a029dbe5 100644 --- a/src/qt/notificator.cpp +++ b/src/qt/notificator.cpp @@ -14,18 +14,18 @@ #include <QSystemTrayIcon> #include <QTemporaryFile> #include <QVariant> - -#ifdef Q_OS_MAC -#include "macnotificationhandler.h" - -#include <ApplicationServices/ApplicationServices.h> -#endif - #ifdef USE_DBUS #include <stdint.h> - #include <QtDBus> #endif +// Include ApplicationServices.h after QtDbus to avoid redefinition of check(). +// This affects at least OSX 10.6. See /usr/include/AssertMacros.h for details. +// Note: This could also be worked around using: +// #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#ifdef Q_OS_MAC +#include <ApplicationServices/ApplicationServices.h> +#include "macnotificationhandler.h" +#endif // https://wiki.ubuntu.com/NotificationDevelopmentGuidelines recommends at least 128 diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 0a569d16f4..d024e3b7aa 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -10,6 +10,7 @@ #include "ui_optionsdialog.h" #include "bitcoinunits.h" +#include "guiutil.h" #include "monitoreddatamapper.h" #include "optionsmodel.h" @@ -19,17 +20,20 @@ #include <QIntValidator> #include <QLocale> #include <QMessageBox> +#include <QTimer> OptionsDialog::OptionsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::OptionsDialog), model(0), mapper(0), - fRestartWarningDisplayed_Proxy(false), - fRestartWarningDisplayed_Lang(false), fProxyIpValid(true) { ui->setupUi(this); + GUIUtil::restoreWindowGeometry("nOptionsDialogWindow", this->size(), this); + + /* Main elements init */ + ui->databaseCache->setMaximum(sizeof(void*) > 4 ? 4096 : 1024); /* Network elements init */ #ifndef USE_UPNP @@ -40,6 +44,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) : ui->proxyPort->setEnabled(false); ui->proxyPort->setValidator(new QIntValidator(1, 65535, this)); + /** SOCKS version is only selectable for default proxy and is always 5 for IPv6 and Tor */ ui->socksVersion->setEnabled(false); ui->socksVersion->addItem("5", 5); ui->socksVersion->addItem("4", 4); @@ -95,16 +100,13 @@ OptionsDialog::OptionsDialog(QWidget *parent) : mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit); mapper->setOrientation(Qt::Vertical); - /* enable apply button when data modified */ - connect(mapper, SIGNAL(viewModified()), this, SLOT(enableApplyButton())); - /* disable apply button when new data loaded */ - connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(disableApplyButton())); /* setup/change UI elements when proxy IP is invalid/valid */ - connect(this, SIGNAL(proxyIpValid(QValidatedLineEdit *, bool)), this, SLOT(handleProxyIpValid(QValidatedLineEdit *, bool))); + connect(this, SIGNAL(proxyIpChecks(QValidatedLineEdit *, int)), this, SLOT(doProxyIpChecks(QValidatedLineEdit *, int))); } OptionsDialog::~OptionsDialog() { + GUIUtil::saveWindowGeometry("nOptionsDialogWindow", this); delete ui; } @@ -114,6 +116,15 @@ void OptionsDialog::setModel(OptionsModel *model) if(model) { + /* check if client restart is needed and show persistent message */ + if (model->isRestartRequired()) + showRestartWarning(true); + + QString strLabel = model->getOverriddenByCommandLine(); + if (strLabel.isEmpty()) + strLabel = tr("none"); + ui->overriddenByCommandLineLabel->setText(strLabel); + connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); mapper->setModel(model); @@ -124,11 +135,15 @@ void OptionsDialog::setModel(OptionsModel *model) /* update the display unit, to not use the default ("BTC") */ updateDisplayUnit(); - /* warn only when language selection changes by user action (placed here so init via mapper doesn't trigger this) */ - connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning_Lang())); + /* warn when one of the following settings changes by user action (placed here so init via mapper doesn't trigger them) */ - /* disable apply button after settings are loaded as there is nothing to save */ - disableApplyButton(); + /* Main */ + connect(ui->databaseCache, SIGNAL(valueChanged(int)), this, SLOT(showRestartWarning())); + connect(ui->threadsScriptVerif, SIGNAL(valueChanged(int)), this, SLOT(showRestartWarning())); + /* Network */ + connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning())); + /* Display */ + connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning())); } void OptionsDialog::setMapper() @@ -136,6 +151,8 @@ void OptionsDialog::setMapper() /* Main */ mapper->addMapping(ui->transactionFee, OptionsModel::Fee); mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup); + mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif); + mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache); /* Network */ mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP); @@ -158,31 +175,20 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures); } -void OptionsDialog::enableApplyButton() -{ - ui->applyButton->setEnabled(true); -} - -void OptionsDialog::disableApplyButton() -{ - ui->applyButton->setEnabled(false); -} - -void OptionsDialog::enableSaveButtons() +void OptionsDialog::enableOkButton() { - /* prevent enabling of the save buttons when data modified, if there is an invalid proxy address present */ + /* prevent enabling of the OK button when data modified, if there is an invalid proxy address present */ if(fProxyIpValid) - setSaveButtonState(true); + setOkButtonState(true); } -void OptionsDialog::disableSaveButtons() +void OptionsDialog::disableOkButton() { - setSaveButtonState(false); + setOkButtonState(false); } -void OptionsDialog::setSaveButtonState(bool fState) +void OptionsDialog::setOkButtonState(bool fState) { - ui->applyButton->setEnabled(fState); ui->okButton->setEnabled(fState); } @@ -192,24 +198,15 @@ void OptionsDialog::on_resetButton_clicked() { // confirmation dialog QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"), - tr("Some settings may require a client restart to take effect.") + "<br><br>" + tr("Do you want to proceed?"), + tr("Client restart required to activate changes.") + "<br><br>" + tr("Client will be shutdown, do you want to proceed?"), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); if(btnRetVal == QMessageBox::Cancel) return; - disableApplyButton(); - - /* disable restart warning messages display */ - fRestartWarningDisplayed_Lang = fRestartWarningDisplayed_Proxy = true; - - /* reset all options and save the default values (QSettings) */ + /* reset all options and close Bitcoin-Qt */ model->Reset(); - mapper->toFirst(); - mapper->submit(); - - /* re-enable restart warning messages display */ - fRestartWarningDisplayed_Lang = fRestartWarningDisplayed_Proxy = false; + QApplication::quit(); } } @@ -224,28 +221,26 @@ void OptionsDialog::on_cancelButton_clicked() reject(); } -void OptionsDialog::on_applyButton_clicked() +void OptionsDialog::showRestartWarning(bool fPersistent) { - mapper->submit(); - disableApplyButton(); -} + ui->statusLabel->setStyleSheet("QLabel { color: red; }"); -void OptionsDialog::showRestartWarning_Proxy() -{ - if(!fRestartWarningDisplayed_Proxy) + if(fPersistent) + { + ui->statusLabel->setText(tr("Client restart required to activate changes.")); + } + else { - QMessageBox::warning(this, tr("Warning"), tr("This setting will take effect after restarting Bitcoin."), QMessageBox::Ok); - fRestartWarningDisplayed_Proxy = true; + ui->statusLabel->setText(tr("This change would require a client restart.")); + // clear non-persistent status label after 10 seconds + // Todo: should perhaps be a class attribute, if we extend the use of statusLabel + QTimer::singleShot(10000, this, SLOT(clearStatusLabel())); } } -void OptionsDialog::showRestartWarning_Lang() +void OptionsDialog::clearStatusLabel() { - if(!fRestartWarningDisplayed_Lang) - { - QMessageBox::warning(this, tr("Warning"), tr("This setting will take effect after restarting Bitcoin."), QMessageBox::Ok); - fRestartWarningDisplayed_Lang = true; - } + ui->statusLabel->clear(); } void OptionsDialog::updateDisplayUnit() @@ -257,22 +252,25 @@ void OptionsDialog::updateDisplayUnit() } } -void OptionsDialog::handleProxyIpValid(QValidatedLineEdit *object, bool fState) +void OptionsDialog::doProxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort) { - // this is used in a check before re-enabling the save buttons - fProxyIpValid = fState; + Q_UNUSED(nProxyPort); - if(fProxyIpValid) + const std::string strAddrProxy = pUiProxyIp->text().toStdString(); + CService addrProxy; + + /* Check for a valid IPv4 / IPv6 address */ + if (!(fProxyIpValid = LookupNumeric(strAddrProxy.c_str(), addrProxy))) { - enableSaveButtons(); - ui->statusLabel->clear(); + disableOkButton(); + pUiProxyIp->setValid(false); + ui->statusLabel->setStyleSheet("QLabel { color: red; }"); + ui->statusLabel->setText(tr("The supplied proxy address is invalid.")); } else { - disableSaveButtons(); - object->setValid(fProxyIpValid); - ui->statusLabel->setStyleSheet("QLabel { color: red; }"); - ui->statusLabel->setText(tr("The supplied proxy address is invalid.")); + enableOkButton(); + ui->statusLabel->clear(); } } @@ -282,9 +280,7 @@ bool OptionsDialog::eventFilter(QObject *object, QEvent *event) { if(object == ui->proxyIp) { - CService addr; - /* Check proxyIp for a valid IPv4/IPv6 address and emit the proxyIpValid signal */ - emit proxyIpValid(ui->proxyIp, LookupNumeric(ui->proxyIp->text().toStdString().c_str(), addr)); + emit proxyIpChecks(ui->proxyIp, ui->proxyPort->text().toInt()); } } return QDialog::eventFilter(object, event); diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 0181905a8c..6b62069660 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -31,35 +31,28 @@ protected: bool eventFilter(QObject *object, QEvent *event); private slots: - /* enable only apply button */ - void enableApplyButton(); - /* disable only apply button */ - void disableApplyButton(); - /* enable apply button and OK button */ - void enableSaveButtons(); - /* disable apply button and OK button */ - void disableSaveButtons(); - /* set apply button and OK button state (enabled / disabled) */ - void setSaveButtonState(bool fState); + /* enable OK button */ + void enableOkButton(); + /* disable OK button */ + void disableOkButton(); + /* set OK button state (enabled / disabled) */ + void setOkButtonState(bool fState); void on_resetButton_clicked(); void on_okButton_clicked(); void on_cancelButton_clicked(); - void on_applyButton_clicked(); - void showRestartWarning_Proxy(); - void showRestartWarning_Lang(); + void showRestartWarning(bool fPersistent = false); + void clearStatusLabel(); void updateDisplayUnit(); - void handleProxyIpValid(QValidatedLineEdit *object, bool fState); + void doProxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort); signals: - void proxyIpValid(QValidatedLineEdit *object, bool fValid); + void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort); private: Ui::OptionsDialog *ui; OptionsModel *model; MonitoredDataMapper *mapper; - bool fRestartWarningDisplayed_Proxy; - bool fRestartWarningDisplayed_Lang; bool fProxyIpValid; }; diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index b64b0dff8b..1133c457b3 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -14,10 +14,13 @@ #include "init.h" #include "main.h" #include "net.h" +#ifdef ENABLE_WALLET #include "wallet.h" #include "walletdb.h" +#endif #include <QSettings> +#include <QStringList> OptionsModel::OptionsModel(QObject *parent) : QAbstractListModel(parent) @@ -25,82 +28,120 @@ OptionsModel::OptionsModel(QObject *parent) : Init(); } -bool static ApplyProxySettings() -{ - QSettings settings; - CService addrProxy(settings.value("addrProxy", "127.0.0.1:9050").toString().toStdString()); - int nSocksVersion(settings.value("nSocksVersion", 5).toInt()); - if (!settings.value("fUseProxy", false).toBool()) { - addrProxy = CService(); - nSocksVersion = 0; - return false; - } - if (nSocksVersion && !addrProxy.IsValid()) - return false; - if (!IsLimited(NET_IPV4)) - SetProxy(NET_IPV4, addrProxy, nSocksVersion); - if (nSocksVersion > 4) { -#ifdef USE_IPV6 - if (!IsLimited(NET_IPV6)) - SetProxy(NET_IPV6, addrProxy, nSocksVersion); -#endif - SetNameProxy(addrProxy, nSocksVersion); - } - return true; -} - +// Writes all missing QSettings with their default values void OptionsModel::Init() { QSettings settings; + // Ensure restart flag is unset on client startup + setRestartRequired(false); + // These are Qt-only settings: - nDisplayUnit = settings.value("nDisplayUnit", BitcoinUnits::BTC).toInt(); + + // Window + if (!settings.contains("fMinimizeToTray")) + settings.setValue("fMinimizeToTray", false); + fMinimizeToTray = settings.value("fMinimizeToTray").toBool(); + + if (!settings.contains("fMinimizeOnClose")) + settings.setValue("fMinimizeOnClose", false); + fMinimizeOnClose = settings.value("fMinimizeOnClose").toBool(); + + // Display + if (!settings.contains("nDisplayUnit")) + settings.setValue("nDisplayUnit", BitcoinUnits::BTC); + nDisplayUnit = settings.value("nDisplayUnit").toInt(); + + if (!settings.contains("bDisplayAddresses")) + settings.setValue("bDisplayAddresses", false); bDisplayAddresses = settings.value("bDisplayAddresses", false).toBool(); - fMinimizeToTray = settings.value("fMinimizeToTray", false).toBool(); - fMinimizeOnClose = settings.value("fMinimizeOnClose", false).toBool(); - nTransactionFee = settings.value("nTransactionFee").toLongLong(); - language = settings.value("language", "").toString(); + + if (!settings.contains("fCoinControlFeatures")) + settings.setValue("fCoinControlFeatures", false); fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool(); - // These are shared with core Bitcoin; we want - // command-line options to override the GUI settings: - if (settings.contains("fUseUPnP")) - SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()); - if (settings.contains("addrProxy") && settings.value("fUseProxy").toBool()) - SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString()); - if (settings.contains("nSocksVersion") && settings.value("fUseProxy").toBool()) - SoftSetArg("-socks", settings.value("nSocksVersion").toString().toStdString()); - if (!language.isEmpty()) - SoftSetArg("-lang", language.toStdString()); + // These are shared with the core or have a command-line parameter + // and we want command-line parameters to overwrite the GUI settings. + // + // If setting doesn't exist create it with defaults. + // + // If SoftSetArg() or SoftSetBoolArg() return false we were overridden + // by command-line and show this in the UI. + + // Main +#ifdef ENABLE_WALLET + if (!settings.contains("nTransactionFee")) + settings.setValue("nTransactionFee", 0); +#endif + + if (!settings.contains("nDatabaseCache")) + settings.setValue("nDatabaseCache", 25); + if (!SoftSetArg("-dbcache", settings.value("nDatabaseCache").toString().toStdString())) + strOverriddenByCommandLine += "-dbcache "; + + if (!settings.contains("nThreadsScriptVerif")) + settings.setValue("nThreadsScriptVerif", 0); + if (!SoftSetArg("-par", settings.value("nThreadsScriptVerif").toString().toStdString())) + strOverriddenByCommandLine += "-par "; + + // Network + if (!settings.contains("fUseUPnP")) +#ifdef USE_UPNP + settings.setValue("fUseUPnP", true); +#else + settings.setValue("fUseUPnP", false); +#endif + if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool())) + strOverriddenByCommandLine += "-upnp "; + + if (!settings.contains("fUseProxy")) + settings.setValue("fUseProxy", false); + if (!settings.contains("addrProxy")) + settings.setValue("addrProxy", "127.0.0.1:9050"); + // Only try to set -proxy, if user has enabled fUseProxy + if (settings.value("fUseProxy").toBool() && !SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString())) + strOverriddenByCommandLine += "-proxy "; + if (!settings.contains("nSocksVersion")) + settings.setValue("nSocksVersion", 5); + // Only try to set -socks, if user has enabled fUseProxy + if (settings.value("fUseProxy").toBool() && !SoftSetArg("-socks", settings.value("nSocksVersion").toString().toStdString())) + strOverriddenByCommandLine += "-socks "; + + // Display + if (!settings.contains("language")) + settings.setValue("language", ""); + if (!SoftSetArg("-lang", settings.value("language").toString().toStdString())) + strOverriddenByCommandLine += "-lang"; + + language = settings.value("language").toString(); } void OptionsModel::Reset() { QSettings settings; - // Remove all entries in this QSettings object + // Remove all entries from our QSettings object settings.clear(); // default setting for OptionsModel::StartAtStartup - disabled if (GUIUtil::GetStartOnSystemStartup()) GUIUtil::SetStartOnSystemStartup(false); - // Re-Init to get default values - Init(); - // Ensure Upgrade() is not running again by setting the bImportFinished flag settings.setValue("bImportFinished", true); } -bool OptionsModel::Upgrade() +void OptionsModel::Upgrade() { QSettings settings; + // Already upgraded if (settings.contains("bImportFinished")) - return false; // Already upgraded + return; settings.setValue("bImportFinished", true); +#ifdef ENABLE_WALLET // Move settings from old wallet.dat (if any): CWalletDB walletdb(strWalletFile); @@ -145,18 +186,17 @@ bool OptionsModel::Upgrade() walletdb.EraseSetting("addrProxy"); } } - ApplyProxySettings(); - Init(); +#endif - return true; + Init(); } - int OptionsModel::rowCount(const QModelIndex & parent) const { return OptionIDRowCount; } +// read QSettings values and return them QVariant OptionsModel::data(const QModelIndex & index, int role) const { if(role == Qt::EditRole) @@ -165,52 +205,57 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const switch(index.row()) { case StartAtStartup: - return QVariant(GUIUtil::GetStartOnSystemStartup()); + return GUIUtil::GetStartOnSystemStartup(); case MinimizeToTray: - return QVariant(fMinimizeToTray); + return fMinimizeToTray; case MapPortUPnP: #ifdef USE_UPNP - return settings.value("fUseUPnP", GetBoolArg("-upnp", true)); + return settings.value("fUseUPnP"); #else - return QVariant(false); + return false; #endif case MinimizeOnClose: - return QVariant(fMinimizeOnClose); - case ProxyUse: { - proxyType proxy; - return QVariant(GetProxy(NET_IPV4, proxy)); - } + return fMinimizeOnClose; + + // default proxy + case ProxyUse: + return settings.value("fUseProxy", false); case ProxyIP: { - proxyType proxy; - if (GetProxy(NET_IPV4, proxy)) - return QVariant(QString::fromStdString(proxy.first.ToStringIP())); - else - return QVariant(QString::fromStdString("127.0.0.1")); + // contains IP at index 0 and port at index 1 + QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + return strlIpPort.at(0); } case ProxyPort: { - proxyType proxy; - if (GetProxy(NET_IPV4, proxy)) - return QVariant(proxy.first.GetPort()); - else - return QVariant(9050); - } - case ProxySocksVersion: { - proxyType proxy; - if (GetProxy(NET_IPV4, proxy)) - return QVariant(proxy.second); - else - return QVariant(5); + // contains IP at index 0 and port at index 1 + QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + return strlIpPort.at(1); } + case ProxySocksVersion: + return settings.value("nSocksVersion", 5); + +#ifdef ENABLE_WALLET case Fee: - return QVariant((qint64) nTransactionFee); + // Attention: Init() is called before nTransactionFee is set in AppInit2()! + // To ensure we can change the fee on-the-fly update our QSetting when + // opening OptionsDialog, which queries Fee via the mapper. + if (nTransactionFee != settings.value("nTransactionFee").toLongLong()) + settings.setValue("nTransactionFee", (qint64)nTransactionFee); + // Todo: Consider to revert back to use just nTransactionFee here, if we don't want + // -paytxfee to update our QSettings! + return settings.value("nTransactionFee"); +#endif case DisplayUnit: - return QVariant(nDisplayUnit); + return nDisplayUnit; case DisplayAddresses: - return QVariant(bDisplayAddresses); + return bDisplayAddresses; case Language: - return settings.value("language", ""); + return settings.value("language"); case CoinControlFeatures: - return QVariant(fCoinControlFeatures); + return fCoinControlFeatures; + case DatabaseCache: + return settings.value("nDatabaseCache"); + case ThreadsScriptVerif: + return settings.value("nThreadsScriptVerif"); default: return QVariant(); } @@ -218,6 +263,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return QVariant(); } +// write QSettings values bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, int role) { bool successful = true; /* set to false on parse error */ @@ -233,7 +279,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in fMinimizeToTray = value.toBool(); settings.setValue("fMinimizeToTray", fMinimizeToTray); break; - case MapPortUPnP: + case MapPortUPnP: // core option - can be changed on-the-fly settings.setValue("fUseUPnP", value.toBool()); MapPort(value.toBool()); break; @@ -241,46 +287,53 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in fMinimizeOnClose = value.toBool(); settings.setValue("fMinimizeOnClose", fMinimizeOnClose); break; + + // default proxy case ProxyUse: - settings.setValue("fUseProxy", value.toBool()); - successful = ApplyProxySettings(); + if (settings.value("fUseProxy") != value) { + settings.setValue("fUseProxy", value.toBool()); + setRestartRequired(true); + } break; case ProxyIP: { - proxyType proxy; - proxy.first = CService("127.0.0.1", 9050); - GetProxy(NET_IPV4, proxy); - - CNetAddr addr(value.toString().toStdString()); - proxy.first.SetIP(addr); - settings.setValue("addrProxy", proxy.first.ToStringIPPort().c_str()); - successful = ApplyProxySettings(); + // contains current IP at index 0 and current port at index 1 + QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + // if that key doesn't exist or has a changed IP + if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) { + // construct new value from new IP and current port + QString strNewValue = value.toString() + ":" + strlIpPort.at(1); + settings.setValue("addrProxy", strNewValue); + setRestartRequired(true); + } } break; case ProxyPort: { - proxyType proxy; - proxy.first = CService("127.0.0.1", 9050); - GetProxy(NET_IPV4, proxy); - - proxy.first.SetPort(value.toInt()); - settings.setValue("addrProxy", proxy.first.ToStringIPPort().c_str()); - successful = ApplyProxySettings(); + // contains current IP at index 0 and current port at index 1 + QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + // if that key doesn't exist or has a changed port + if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) { + // construct new value from current IP and new port + QString strNewValue = strlIpPort.at(0) + ":" + value.toString(); + settings.setValue("addrProxy", strNewValue); + setRestartRequired(true); + } } break; case ProxySocksVersion: { - proxyType proxy; - proxy.second = 5; - GetProxy(NET_IPV4, proxy); - - proxy.second = value.toInt(); - settings.setValue("nSocksVersion", proxy.second); - successful = ApplyProxySettings(); + if (settings.value("nSocksVersion") != value) { + settings.setValue("nSocksVersion", value.toInt()); + setRestartRequired(true); + } } break; - case Fee: +#ifdef ENABLE_WALLET + case Fee: // core option - can be changed on-the-fly + // Todo: Add is valid check and warn via message, if not nTransactionFee = value.toLongLong(); - settings.setValue("nTransactionFee", (qint64) nTransactionFee); + settings.setValue("nTransactionFee", (qint64)nTransactionFee); emit transactionFeeChanged(nTransactionFee); break; +#endif case DisplayUnit: nDisplayUnit = value.toInt(); settings.setValue("nDisplayUnit", nDisplayUnit); @@ -291,13 +344,28 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("bDisplayAddresses", bDisplayAddresses); break; case Language: - settings.setValue("language", value); + if (settings.value("language") != value) { + settings.setValue("language", value); + setRestartRequired(true); + } break; case CoinControlFeatures: fCoinControlFeatures = value.toBool(); settings.setValue("fCoinControlFeatures", fCoinControlFeatures); emit coinControlFeaturesChanged(fCoinControlFeatures); break; + case DatabaseCache: + if (settings.value("nDatabaseCache") != value) { + settings.setValue("nDatabaseCache", value); + setRestartRequired(true); + } + break; + case ThreadsScriptVerif: + if (settings.value("nThreadsScriptVerif") != value) { + settings.setValue("nThreadsScriptVerif", value); + setRestartRequired(true); + } + break; default: break; } @@ -317,3 +385,15 @@ bool OptionsModel::getProxySettings(QString& proxyIP, quint16 &proxyPort) const proxyPort = addrProxy.GetPort(); return true; } + +void OptionsModel::setRestartRequired(bool fRequired) +{ + QSettings settings; + return settings.setValue("fRestartRequired", fRequired); +} + +bool OptionsModel::isRestartRequired() +{ + QSettings settings; + return settings.value("fRestartRequired", false).toBool(); +} diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index a50153c768..d05cb46746 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -34,6 +34,8 @@ public: DisplayAddresses, // bool Language, // QString CoinControlFeatures, // bool + ThreadsScriptVerif, // int + DatabaseCache, // int OptionIDRowCount, }; @@ -41,7 +43,7 @@ public: void Reset(); /* Migrate settings from wallet.dat after app initialization */ - bool Upgrade(); /* returns true if settings upgraded */ + void Upgrade(); int rowCount(const QModelIndex & parent = QModelIndex()) const; QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; @@ -52,17 +54,24 @@ public: bool getMinimizeOnClose() { return fMinimizeOnClose; } int getDisplayUnit() { return nDisplayUnit; } bool getDisplayAddresses() { return bDisplayAddresses; } - QString getLanguage() { return language; } bool getProxySettings(QString& proxyIP, quint16 &proxyPort) const; bool getCoinControlFeatures() { return fCoinControlFeatures; } + const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; } + + /* Restart flag helper */ + void setRestartRequired(bool fRequired); + bool isRestartRequired(); private: - int nDisplayUnit; - bool bDisplayAddresses; + /* Qt-only settings */ bool fMinimizeToTray; bool fMinimizeOnClose; QString language; + int nDisplayUnit; + bool bDisplayAddresses; bool fCoinControlFeatures; + /* settings that were overriden by command-line */ + QString strOverriddenByCommandLine; signals: void displayUnitChanged(int unit); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index cfa87c16ba..7642cd117a 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -8,8 +8,6 @@ #include "guiconstants.h" #include "guiutil.h" #include "optionsmodel.h" -#include "paymentserver.h" -#include "walletmodel.h" #include "base58.h" #include "ui_interface.h" @@ -180,10 +178,8 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store) // and the items in savedPaymentRequest will be handled // when uiReady() is called. // -bool PaymentServer::ipcSendCommandLine(int argc, char* argv[]) +bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { - bool fResult = false; - for (int i = 1; i < argc; i++) { QString arg(argv[i]); @@ -226,7 +222,18 @@ bool PaymentServer::ipcSendCommandLine(int argc, char* argv[]) qDebug() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg; } } + return true; +} +// +// Sending to the server is done synchronously, at startup. +// If the server isn't already running, startup continues, +// and the items in savedPaymentRequest will be handled +// when uiReady() is called. +// +bool PaymentServer::ipcSendCommandLine() +{ + bool fResult = false; foreach (const QString& r, savedPaymentRequests) { QLocalSocket* socket = new QLocalSocket(); @@ -373,40 +380,52 @@ void PaymentServer::handleURIOrFile(const QString& s) #else QUrlQuery uri((QUrl(s))); #endif - if (uri.hasQueryItem("r")) + if (uri.hasQueryItem("r")) // payment request URI { QByteArray temp; temp.append(uri.queryItemValue("r")); QString decoded = QUrl::fromPercentEncoding(temp); QUrl fetchUrl(decoded, QUrl::StrictMode); - qDebug() << "PaymentServer::handleURIOrFile : fetchRequest(" << fetchUrl << ")"; - if (fetchUrl.isValid()) + { + qDebug() << "PaymentServer::handleURIOrFile : fetchRequest(" << fetchUrl << ")"; fetchRequest(fetchUrl); + } else + { qDebug() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl; + emit message(tr("URI handling"), + tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()), + CClientUIInterface::ICON_WARNING); + } return; } + else // normal URI + { + SendCoinsRecipient recipient; + if (GUIUtil::parseBitcoinURI(s, &recipient)) + emit receivedPaymentRequest(recipient); + else + emit message(tr("URI handling"), + tr("URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."), + CClientUIInterface::ICON_WARNING); - SendCoinsRecipient recipient; - if (GUIUtil::parseBitcoinURI(s, &recipient)) - emit receivedPaymentRequest(recipient); - else - emit message(tr("URI handling"), - tr("URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."), - CClientUIInterface::ICON_WARNING); - - return; + return; + } } - if (QFile::exists(s)) + if (QFile::exists(s)) // payment request file { PaymentRequestPlus request; SendCoinsRecipient recipient; if (readPaymentRequest(s, request) && processPaymentRequest(request, recipient)) emit receivedPaymentRequest(recipient); + else + emit message(tr("Payment request file handling"), + tr("Payment request file can not be read or processed! This can be caused by an invalid payment request file."), + CClientUIInterface::ICON_WARNING); return; } @@ -585,7 +604,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) .arg(reply->errorString()); qDebug() << "PaymentServer::netRequestFinished : " << msg; - emit message(tr("Network request error"), msg, CClientUIInterface::MSG_ERROR); + emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); return; } @@ -597,9 +616,16 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) PaymentRequestPlus request; SendCoinsRecipient recipient; if (request.parse(data) && processPaymentRequest(request, recipient)) + { emit receivedPaymentRequest(recipient); + } else + { qDebug() << "PaymentServer::netRequestFinished : Error processing payment request"; + emit message(tr("Payment request error"), + tr("Payment request can not be parsed or processed!"), + CClientUIInterface::MSG_ERROR); + } return; } @@ -612,9 +638,10 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply) .arg(reply->request().url().toString()); qDebug() << "PaymentServer::netRequestFinished : " << msg; - emit message(tr("Network request error"), msg, CClientUIInterface::MSG_ERROR); + emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); } - else { + else + { emit receivedPaymentACK(GUIUtil::HtmlEscape(paymentACK.memo())); } } diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index ab59388acc..af19661bdd 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -56,12 +56,16 @@ class PaymentServer : public QObject Q_OBJECT public: + // Parse URIs on command line + // Returns false on error + static bool ipcParseCommandLine(int argc, char *argv[]); + // Returns true if there were URIs on the command line // which were successfully sent to an already-running // process. // Note: if a payment request is given, SelectParams(MAIN/TESTNET) // will be called so we startup in the right mode. - static bool ipcSendCommandLine(int argc, char *argv[]); + static bool ipcSendCommandLine(); // parent should be QApplication object PaymentServer(QObject* parent, bool startLocalServer = true); @@ -98,7 +102,7 @@ public slots: // Submit Payment message to a merchant, get back PaymentACK: void fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction); - // Handle an incoming URI or file + // Handle an incoming URI, URI with local file scheme or file void handleURIOrFile(const QString& s); private slots: diff --git a/src/qt/res/icons/notsynced.png b/src/qt/res/icons/notsynced.png Binary files differdeleted file mode 100644 index 87b1c3290b..0000000000 --- a/src/qt/res/icons/notsynced.png +++ /dev/null diff --git a/src/qt/res/movies/spinner-000.png b/src/qt/res/movies/spinner-000.png Binary files differnew file mode 100644 index 0000000000..1f4fb732ef --- /dev/null +++ b/src/qt/res/movies/spinner-000.png diff --git a/src/qt/res/movies/spinner-001.png b/src/qt/res/movies/spinner-001.png Binary files differnew file mode 100644 index 0000000000..e6ca67a1b0 --- /dev/null +++ b/src/qt/res/movies/spinner-001.png diff --git a/src/qt/res/movies/spinner-002.png b/src/qt/res/movies/spinner-002.png Binary files differnew file mode 100644 index 0000000000..2360467aff --- /dev/null +++ b/src/qt/res/movies/spinner-002.png diff --git a/src/qt/res/movies/spinner-003.png b/src/qt/res/movies/spinner-003.png Binary files differnew file mode 100644 index 0000000000..52bed62566 --- /dev/null +++ b/src/qt/res/movies/spinner-003.png diff --git a/src/qt/res/movies/spinner-004.png b/src/qt/res/movies/spinner-004.png Binary files differnew file mode 100644 index 0000000000..de5c88a56f --- /dev/null +++ b/src/qt/res/movies/spinner-004.png diff --git a/src/qt/res/movies/spinner-005.png b/src/qt/res/movies/spinner-005.png Binary files differnew file mode 100644 index 0000000000..27b30336a1 --- /dev/null +++ b/src/qt/res/movies/spinner-005.png diff --git a/src/qt/res/movies/spinner-006.png b/src/qt/res/movies/spinner-006.png Binary files differnew file mode 100644 index 0000000000..1fa6b0e242 --- /dev/null +++ b/src/qt/res/movies/spinner-006.png diff --git a/src/qt/res/movies/spinner-007.png b/src/qt/res/movies/spinner-007.png Binary files differnew file mode 100644 index 0000000000..f54fa8775e --- /dev/null +++ b/src/qt/res/movies/spinner-007.png diff --git a/src/qt/res/movies/spinner-008.png b/src/qt/res/movies/spinner-008.png Binary files differnew file mode 100644 index 0000000000..d25aa5300f --- /dev/null +++ b/src/qt/res/movies/spinner-008.png diff --git a/src/qt/res/movies/spinner-009.png b/src/qt/res/movies/spinner-009.png Binary files differnew file mode 100644 index 0000000000..1349b87586 --- /dev/null +++ b/src/qt/res/movies/spinner-009.png diff --git a/src/qt/res/movies/spinner-010.png b/src/qt/res/movies/spinner-010.png Binary files differnew file mode 100644 index 0000000000..6020e275f1 --- /dev/null +++ b/src/qt/res/movies/spinner-010.png diff --git a/src/qt/res/movies/spinner-011.png b/src/qt/res/movies/spinner-011.png Binary files differnew file mode 100644 index 0000000000..0d0e811ea7 --- /dev/null +++ b/src/qt/res/movies/spinner-011.png diff --git a/src/qt/res/movies/spinner-012.png b/src/qt/res/movies/spinner-012.png Binary files differnew file mode 100644 index 0000000000..937afb6be2 --- /dev/null +++ b/src/qt/res/movies/spinner-012.png diff --git a/src/qt/res/movies/spinner-013.png b/src/qt/res/movies/spinner-013.png Binary files differnew file mode 100644 index 0000000000..4ae5a671a3 --- /dev/null +++ b/src/qt/res/movies/spinner-013.png diff --git a/src/qt/res/movies/spinner-014.png b/src/qt/res/movies/spinner-014.png Binary files differnew file mode 100644 index 0000000000..c3a81add0e --- /dev/null +++ b/src/qt/res/movies/spinner-014.png diff --git a/src/qt/res/movies/spinner-015.png b/src/qt/res/movies/spinner-015.png Binary files differnew file mode 100644 index 0000000000..184a9fe424 --- /dev/null +++ b/src/qt/res/movies/spinner-015.png diff --git a/src/qt/res/movies/spinner-016.png b/src/qt/res/movies/spinner-016.png Binary files differnew file mode 100644 index 0000000000..2da9b9dc72 --- /dev/null +++ b/src/qt/res/movies/spinner-016.png diff --git a/src/qt/res/movies/spinner-017.png b/src/qt/res/movies/spinner-017.png Binary files differnew file mode 100644 index 0000000000..ada83fbe84 --- /dev/null +++ b/src/qt/res/movies/spinner-017.png diff --git a/src/qt/res/movies/spinner-018.png b/src/qt/res/movies/spinner-018.png Binary files differnew file mode 100644 index 0000000000..cc436ba8cb --- /dev/null +++ b/src/qt/res/movies/spinner-018.png diff --git a/src/qt/res/movies/spinner-019.png b/src/qt/res/movies/spinner-019.png Binary files differnew file mode 100644 index 0000000000..03da25bc2a --- /dev/null +++ b/src/qt/res/movies/spinner-019.png diff --git a/src/qt/res/movies/spinner-020.png b/src/qt/res/movies/spinner-020.png Binary files differnew file mode 100644 index 0000000000..e7f2ac78e8 --- /dev/null +++ b/src/qt/res/movies/spinner-020.png diff --git a/src/qt/res/movies/spinner-021.png b/src/qt/res/movies/spinner-021.png Binary files differnew file mode 100644 index 0000000000..dc9e580bf3 --- /dev/null +++ b/src/qt/res/movies/spinner-021.png diff --git a/src/qt/res/movies/spinner-022.png b/src/qt/res/movies/spinner-022.png Binary files differnew file mode 100644 index 0000000000..6e236c805e --- /dev/null +++ b/src/qt/res/movies/spinner-022.png diff --git a/src/qt/res/movies/spinner-023.png b/src/qt/res/movies/spinner-023.png Binary files differnew file mode 100644 index 0000000000..f1c3228485 --- /dev/null +++ b/src/qt/res/movies/spinner-023.png diff --git a/src/qt/res/movies/spinner-024.png b/src/qt/res/movies/spinner-024.png Binary files differnew file mode 100644 index 0000000000..d8cf21f178 --- /dev/null +++ b/src/qt/res/movies/spinner-024.png diff --git a/src/qt/res/movies/spinner-025.png b/src/qt/res/movies/spinner-025.png Binary files differnew file mode 100644 index 0000000000..2b5ede3293 --- /dev/null +++ b/src/qt/res/movies/spinner-025.png diff --git a/src/qt/res/movies/spinner-026.png b/src/qt/res/movies/spinner-026.png Binary files differnew file mode 100644 index 0000000000..5ee3d2fa8e --- /dev/null +++ b/src/qt/res/movies/spinner-026.png diff --git a/src/qt/res/movies/spinner-027.png b/src/qt/res/movies/spinner-027.png Binary files differnew file mode 100644 index 0000000000..c2ee8082bd --- /dev/null +++ b/src/qt/res/movies/spinner-027.png diff --git a/src/qt/res/movies/spinner-028.png b/src/qt/res/movies/spinner-028.png Binary files differnew file mode 100644 index 0000000000..f70d3531ad --- /dev/null +++ b/src/qt/res/movies/spinner-028.png diff --git a/src/qt/res/movies/spinner-029.png b/src/qt/res/movies/spinner-029.png Binary files differnew file mode 100644 index 0000000000..02b97207a9 --- /dev/null +++ b/src/qt/res/movies/spinner-029.png diff --git a/src/qt/res/movies/spinner-030.png b/src/qt/res/movies/spinner-030.png Binary files differnew file mode 100644 index 0000000000..0c74e82c6f --- /dev/null +++ b/src/qt/res/movies/spinner-030.png diff --git a/src/qt/res/movies/spinner-031.png b/src/qt/res/movies/spinner-031.png Binary files differnew file mode 100644 index 0000000000..c5e29bcec7 --- /dev/null +++ b/src/qt/res/movies/spinner-031.png diff --git a/src/qt/res/movies/spinner-032.png b/src/qt/res/movies/spinner-032.png Binary files differnew file mode 100644 index 0000000000..d72c9bf0dd --- /dev/null +++ b/src/qt/res/movies/spinner-032.png diff --git a/src/qt/res/movies/spinner-033.png b/src/qt/res/movies/spinner-033.png Binary files differnew file mode 100644 index 0000000000..a8b822bfaf --- /dev/null +++ b/src/qt/res/movies/spinner-033.png diff --git a/src/qt/res/movies/spinner-034.png b/src/qt/res/movies/spinner-034.png Binary files differnew file mode 100644 index 0000000000..684aa385e0 --- /dev/null +++ b/src/qt/res/movies/spinner-034.png diff --git a/src/qt/res/movies/update_spinner.mng b/src/qt/res/movies/update_spinner.mng Binary files differdeleted file mode 100644 index 7df3baac6f..0000000000 --- a/src/qt/res/movies/update_spinner.mng +++ /dev/null diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index a8470572dd..abb6ceb139 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -7,6 +7,7 @@ #include "clientmodel.h" #include "guiutil.h" +#include "utilitydialog.h" #include "rpcserver.h" #include "rpcclient.h" @@ -443,8 +444,8 @@ void RPCConsole::scrollToEnd() void RPCConsole::on_showCLOptionsButton_clicked() { - GUIUtil::HelpMessageBox help; - help.exec(); + HelpMessageDialog *help = new HelpMessageDialog(this); + help->show(); } void RPCConsole::on_sldGraphRange_valueChanged(int value) diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 6fb834c045..8b16496c18 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -6,6 +6,7 @@ #include "clientversion.h" #include "util.h" +#include "ui_interface.h" #include <QApplication> #include <QPainter> @@ -13,6 +14,8 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTestNet) : QSplashScreen(pixmap, f) { + setAutoFillBackground(true); + // set reference point, paddings int paddingRight = 50; int paddingTop = 50; @@ -83,4 +86,37 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTest pixPaint.end(); this->setPixmap(newPixmap); + + subscribeToCoreSignals(); +} + +SplashScreen::~SplashScreen() +{ + unsubscribeFromCoreSignals(); +} + +void SplashScreen::slotFinish(QWidget *mainWin) +{ + finish(mainWin); +} + +static void InitMessage(SplashScreen *splash, const std::string &message) +{ + QMetaObject::invokeMethod(splash, "showMessage", + Qt::QueuedConnection, + Q_ARG(QString, QString::fromStdString(message)), + Q_ARG(int, Qt::AlignBottom|Qt::AlignHCenter), + Q_ARG(QColor, QColor(55,55,55))); +} + +void SplashScreen::subscribeToCoreSignals() +{ + // Connect signals to client + uiInterface.InitMessage.connect(boost::bind(InitMessage, this, _1)); +} + +void SplashScreen::unsubscribeFromCoreSignals() +{ + // Disconnect signals from client + uiInterface.InitMessage.disconnect(boost::bind(InitMessage, this, _1)); } diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h index 070e376c95..6bc10e60ab 100644 --- a/src/qt/splashscreen.h +++ b/src/qt/splashscreen.h @@ -15,6 +15,17 @@ class SplashScreen : public QSplashScreen public: explicit SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f, bool isTestNet); + ~SplashScreen(); + +public slots: + /** Slot to call finish() method as it's not defined as slot */ + void slotFinish(QWidget *mainWin); + +private: + /** Connect core signals to splash screen */ + void subscribeToCoreSignals(); + /** Disconnect core signals to splash screen */ + void unsubscribeFromCoreSignals(); }; #endif // SPLASHSCREEN_H diff --git a/src/qt/test/Makefile.am b/src/qt/test/Makefile.am index cb6874700e..00ccfadf3f 100644 --- a/src/qt/test/Makefile.am +++ b/src/qt/test/Makefile.am @@ -8,18 +8,38 @@ AM_CPPFLAGS += -I$(top_srcdir)/src \ bin_PROGRAMS = test_bitcoin-qt TESTS = test_bitcoin-qt -TEST_QT_MOC_CPP = moc_uritests.cpp moc_paymentservertests.cpp +TEST_QT_MOC_CPP = moc_uritests.cpp -TEST_QT_H = uritests.h paymentservertests.h paymentrequestdata.h +if ENABLE_WALLET +TEST_QT_MOC_CPP += moc_paymentservertests.cpp +endif + +TEST_QT_H = \ + uritests.h \ + paymentrequestdata.h \ + paymentservertests.h BUILT_SOURCES = $(TEST_QT_MOC_CPP) test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES) -test_bitcoin_qt_SOURCES = test_main.cpp uritests.cpp paymentservertests.cpp $(TEST_QT_H) + +test_bitcoin_qt_SOURCES = \ + test_main.cpp \ + uritests.cpp \ + $(TEST_QT_H) +if ENABLE_WALLET +test_bitcoin_qt_SOURCES += \ + paymentservertests.cpp +endif + nodist_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP) -test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) $(LIBBITCOIN_WALLET) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ - $(LIBMEMENV) $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \ + +test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) +if ENABLE_WALLET +test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) +endif +test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ + $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) CLEANFILES = $(BUILT_SOURCES) *.gcda *.gcno - diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index ae584706f1..a2adb00327 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -1,10 +1,25 @@ +#include "bitcoin-config.h" +#if defined(HAVE_CONFIG_H) +#include "bitcoin-config.h" +#endif + +#ifdef ENABLE_WALLET #include "paymentservertests.h" +#endif #include "uritests.h" #include <QCoreApplication> #include <QObject> #include <QTest> +#if defined(QT_STATICPLUGIN) && QT_VERSION < 0x050000 +#include <QtPlugin> +Q_IMPORT_PLUGIN(qcncodecs) +Q_IMPORT_PLUGIN(qjpcodecs) +Q_IMPORT_PLUGIN(qtwcodecs) +Q_IMPORT_PLUGIN(qkrcodecs) +#endif + // This is all you need to run all the tests int main(int argc, char *argv[]) { @@ -18,10 +33,11 @@ int main(int argc, char *argv[]) URITests test1; if (QTest::qExec(&test1) != 0) fInvalid = true; - +#ifdef ENABLE_WALLET PaymentServerTests test2; if (QTest::qExec(&test2) != 0) fInvalid = true; +#endif return fInvalid; } diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp new file mode 100644 index 0000000000..05a01c7445 --- /dev/null +++ b/src/qt/utilitydialog.cpp @@ -0,0 +1,125 @@ +// Copyright (c) 2011-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "utilitydialog.h" + +#include "ui_aboutdialog.h" +#include "ui_helpmessagedialog.h" + +#include "bitcoingui.h" +#include "clientmodel.h" +#include "guiutil.h" + +#include "clientversion.h" +#include "init.h" +#include "util.h" + +#include <QLabel> +#include <QVBoxLayout> + +/** "About" dialog box */ +AboutDialog::AboutDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AboutDialog) +{ + ui->setupUi(this); + + // Set current copyright year + ui->copyrightLabel->setText(tr("Copyright") + QString(" © 2009-%1 ").arg(COPYRIGHT_YEAR) + tr("The Bitcoin Core developers")); +} + +void AboutDialog::setModel(ClientModel *model) +{ + if(model) + { + ui->versionLabel->setText(model->formatFullVersion()); + } +} + +AboutDialog::~AboutDialog() +{ + delete ui; +} + +void AboutDialog::on_buttonBox_accepted() +{ + close(); +} + +/** "Help message" dialog box */ +HelpMessageDialog::HelpMessageDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::HelpMessageDialog) +{ + ui->setupUi(this); + GUIUtil::restoreWindowGeometry("nHelpMessageDialogWindow", this->size(), this); + + header = tr("Bitcoin Core") + " " + tr("version") + " " + + QString::fromStdString(FormatFullVersion()) + "\n\n" + + tr("Usage:") + "\n" + + " bitcoin-qt [" + tr("command-line options") + "] " + "\n"; + + coreOptions = QString::fromStdString(HelpMessage(HMM_BITCOIN_QT)); + + uiOptions = tr("UI options") + ":\n" + + " -lang=<lang> " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" + + " -min " + tr("Start minimized") + "\n" + + " -splash " + tr("Show splash screen on startup (default: 1)") + "\n" + + " -choosedatadir " + tr("Choose data directory on startup (default: 0)"); + + ui->helpMessageLabel->setFont(GUIUtil::bitcoinAddressFont()); + + // Set help message text + ui->helpMessageLabel->setText(header + "\n" + coreOptions + "\n" + uiOptions); +} + +HelpMessageDialog::~HelpMessageDialog() +{ + GUIUtil::saveWindowGeometry("nHelpMessageDialogWindow", this); + delete ui; +} + +void HelpMessageDialog::printToConsole() +{ + // On other operating systems, the expected action is to print the message to the console. + QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions; + fprintf(stdout, "%s", strUsage.toStdString().c_str()); +} + +void HelpMessageDialog::showOrPrint() +{ +#if defined(WIN32) + // On Windows, show a message box, as there is no stderr/stdout in windowed applications + exec(); +#else + // On other operating systems, print help text to console + printToConsole(); +#endif +} + +void HelpMessageDialog::on_okButton_accepted() +{ + close(); +} + + +/** "Shutdown" window */ +void ShutdownWindow::showShutdownWindow(BitcoinGUI *window) +{ + if (!window) + return; + + // Show a simple window indicating shutdown status + QWidget *shutdownWindow = new QWidget(); + QVBoxLayout *layout = new QVBoxLayout(); + layout->addWidget(new QLabel( + tr("Bitcoin Core is shutting down...") + "<br /><br />" + + tr("Do not shut down the computer until this window disappears."))); + shutdownWindow->setLayout(layout); + + // Center shutdown window at where main window was + const QPoint global = window->mapToGlobal(window->rect().center()); + shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2); + shutdownWindow->show(); +} diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h new file mode 100644 index 0000000000..874daf6a7f --- /dev/null +++ b/src/qt/utilitydialog.h @@ -0,0 +1,69 @@ +// Copyright (c) 2011-2014 The Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef UTILITYDIALOG_H +#define UTILITYDIALOG_H + +#include <QDialog> +#include <QObject> + +class BitcoinGUI; +class ClientModel; + +namespace Ui { + class AboutDialog; + class HelpMessageDialog; +} + +/** "About" dialog box */ +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget *parent); + ~AboutDialog(); + + void setModel(ClientModel *model); + +private: + Ui::AboutDialog *ui; + +private slots: + void on_buttonBox_accepted(); +}; + +/** "Help message" dialog box */ +class HelpMessageDialog : public QDialog +{ + Q_OBJECT + +public: + explicit HelpMessageDialog(QWidget *parent); + ~HelpMessageDialog(); + + void printToConsole(); + void showOrPrint(); + +private: + Ui::HelpMessageDialog *ui; + QString header; + QString coreOptions; + QString uiOptions; + +private slots: + void on_okButton_accepted(); +}; + + +/** "Shutdown" window */ +class ShutdownWindow : public QObject +{ + Q_OBJECT + +public: + static void showShutdownWindow(BitcoinGUI *window); +}; + +#endif // UTILITYDIALOG_H diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 6f3e3b0aaf..14f29c933b 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -488,6 +488,7 @@ bool WalletModel::getPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const // returns a list of COutputs from COutPoints void WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs) { + LOCK(wallet->cs_wallet); BOOST_FOREACH(const COutPoint& outpoint, vOutpoints) { if (!wallet->mapWallet.count(outpoint.hash)) continue; diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index c61cc4192b..f8a7d07fc3 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -4,11 +4,11 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" -#include "rpcserver.h" #include "init.h" #include "main.h" #include "net.h" #include "netbase.h" +#include "rpcserver.h" #include "util.h" #ifdef ENABLE_WALLET #include "wallet.h" @@ -323,4 +323,3 @@ Value verifymessage(const Array& params, bool fHelp) return (pubkey.GetID() == keyID); } - diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 86025918ef..ff652ca34d 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -4,13 +4,13 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" -#include "rpcserver.h" +#include "core.h" #include "init.h" +#include "keystore.h" +#include "main.h" #include "net.h" +#include "rpcserver.h" #include "uint256.h" -#include "core.h" -#include "main.h" -#include "keystore.h" #ifdef ENABLE_WALLET #include "wallet.h" #endif diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 9f2100a8d7..9d34a900ff 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -8,8 +8,8 @@ #include "base58.h" #include "init.h" #include "main.h" -#include "util.h" #include "ui_interface.h" +#include "util.h" #ifdef ENABLE_WALLET #include "wallet.h" #endif diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 384616e897..667e53c6b4 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -6,12 +6,15 @@ bin_PROGRAMS = test_bitcoin TESTS = test_bitcoin -JSON_TEST_FILES= data/script_valid.json \ - data/base58_keys_valid.json data/sig_canonical.json \ +JSON_TEST_FILES = \ + data/script_valid.json \ + data/base58_keys_valid.json \ + data/sig_canonical.json \ data/sig_noncanonical.json \ data/base58_encode_decode.json \ data/base58_keys_invalid.json \ - data/script_invalid.json data/tx_invalid.json \ + data/script_invalid.json \ + data/tx_invalid.json \ data/tx_valid.json RAW_TEST_FILES = data/alertTests.raw @@ -27,18 +30,43 @@ test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) endif test_bitcoin_LDADD += $(BDB_LIBS) -test_bitcoin_SOURCES = alert_tests.cpp \ - allocator_tests.cpp base32_tests.cpp base58_tests.cpp base64_tests.cpp \ - bignum_tests.cpp bloom_tests.cpp canonical_tests.cpp checkblock_tests.cpp \ - Checkpoints_tests.cpp compress_tests.cpp DoS_tests.cpp getarg_tests.cpp \ - key_tests.cpp miner_tests.cpp mruset_tests.cpp multisig_tests.cpp \ - netbase_tests.cpp pmt_tests.cpp rpc_tests.cpp script_P2SH_tests.cpp \ - script_tests.cpp serialize_tests.cpp sigopcount_tests.cpp test_bitcoin.cpp \ - transaction_tests.cpp uint256_tests.cpp util_tests.cpp \ - sighash_tests.cpp $(JSON_TEST_FILES) $(RAW_TEST_FILES) +test_bitcoin_SOURCES = \ + alert_tests.cpp \ + allocator_tests.cpp \ + base32_tests.cpp \ + base58_tests.cpp \ + base64_tests.cpp \ + bignum_tests.cpp \ + bloom_tests.cpp \ + canonical_tests.cpp \ + checkblock_tests.cpp \ + Checkpoints_tests.cpp \ + compress_tests.cpp \ + DoS_tests.cpp \ + getarg_tests.cpp \ + key_tests.cpp \ + miner_tests.cpp \ + mruset_tests.cpp \ + multisig_tests.cpp \ + netbase_tests.cpp \ + pmt_tests.cpp \ + rpc_tests.cpp \ + script_P2SH_tests.cpp \ + script_tests.cpp \ + serialize_tests.cpp \ + sigopcount_tests.cpp \ + test_bitcoin.cpp \ + transaction_tests.cpp \ + uint256_tests.cpp \ + util_tests.cpp \ + sighash_tests.cpp \ + $(JSON_TEST_FILES) $(RAW_TEST_FILES) if ENABLE_WALLET -test_bitcoin_SOURCES += accounting_tests.cpp wallet_tests.cpp rpc_wallet_tests.cpp +test_bitcoin_SOURCES += \ + accounting_tests.cpp \ + wallet_tests.cpp \ + rpc_wallet_tests.cpp endif nodist_test_bitcoin_SOURCES = $(BUILT_SOURCES) diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index b57945d061..691f02a9d7 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -330,4 +330,12 @@ BOOST_AUTO_TEST_CASE(strprintf_numbers) #undef B #undef E +/* Check for mingw/wine issue #3494 + * Remove this test before time.ctime(0xffffffff) == 'Sun Feb 7 07:28:15 2106' + */ +BOOST_AUTO_TEST_CASE(gettime) +{ + BOOST_CHECK((GetTime() & ~0xFFFFFFFFLL) == 0); +} + BOOST_AUTO_TEST_SUITE_END() diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 2dc6594e93..9c5bddba60 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -357,16 +357,13 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, { uint256 hash; ssKey >> hash; - CWalletTx& wtx = pwallet->mapWallet[hash]; + CWalletTx wtx; ssValue >> wtx; CValidationState state; if (CheckTransaction(wtx, state) && (wtx.GetHash() == hash) && state.IsValid()) wtx.BindWallet(pwallet); else - { - pwallet->mapWallet.erase(hash); return false; - } // Undo serialize changes in 31600 if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703) @@ -391,6 +388,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, if (wtx.nOrderPos == -1) wss.fAnyUnordered = true; + pwallet->mapWallet[hash] = wtx; //// debug print //LogPrintf("LoadWallet %s\n", wtx.GetHash().ToString().c_str()); //LogPrintf(" %12"PRId64" %s %s %s\n", |