From d58ff4eb018d502fd4d7c825d27bfa7f2a2354f6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 8 Jul 2019 20:22:55 +0200 Subject: [PATCH 1/6] Merge #14505: test: Add linter to make sure single parameter constructors are marked explicit c4606b84329d760d7cee144bebe05807857edaae Add Travis check for single parameter constructors not marked "explicit" (practicalswift) Pull request description: Make single parameter constructors `explicit` (C++11). Rationale from the developer notes: > - By default, declare single-argument constructors `explicit`. > - *Rationale*: This is a precaution to avoid unintended conversions that might > arise when single-argument constructors are used as implicit conversion > functions. ACKs for top commit: laanwj: ACK c4606b84329d760d7cee144bebe05807857edaae Tree-SHA512: 3e6fd51935fd93b2604b2188664692973d0897469f814cd745b5147d71b99ea5d73c1081cfde9f6393f51f56969e412fcda35d2d54e938a3235b8d40945f31fd --- .travis.yml | 13 +++++ .travis/extended_lint_04_install.sh | 12 +++++ .travis/extended_lint_06_script.sh | 9 ++++ ci/build_src.sh | 1 + src/index/blockfilterindex.cpp | 4 +- src/interfaces/chain.cpp | 2 +- src/rpc/util.h | 2 +- test/lint/extended-lint-all.sh | 26 ++++++++++ test/lint/extended-lint-cppcheck.sh | 80 +++++++++++++++++++++++++++++ 9 files changed, 145 insertions(+), 4 deletions(-) create mode 100755 .travis/extended_lint_04_install.sh create mode 100755 .travis/extended_lint_06_script.sh create mode 100755 test/lint/extended-lint-all.sh create mode 100755 test/lint/extended-lint-cppcheck.sh diff --git a/.travis.yml b/.travis.yml index b6fbd97406..498a8bcfd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -204,6 +204,19 @@ after_success: script: - set -o errexit; source .travis/lint_06_script.sh + - stage: extended-lint + name: 'extended lint [runtime >= 60 seconds]' + env: + cache: false + language: python + python: '3.5' + install: + - set -o errexit; source .travis/extended_lint_04_install.sh + before_script: + - set -o errexit; source .travis/lint_05_before_script.sh + script: + - set -o errexit; source .travis/extended_lint_06_script.sh + - stage: test name: 'ARM [GOAL: install] [no unit or functional tests]' env: >- diff --git a/.travis/extended_lint_04_install.sh b/.travis/extended_lint_04_install.sh new file mode 100755 index 0000000000..123d874a84 --- /dev/null +++ b/.travis/extended_lint_04_install.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2019 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C + +CPPCHECK_VERSION=1.86 +curl -s https://codeload.github.com/danmar/cppcheck/tar.gz/${CPPCHECK_VERSION} | tar -zxf - --directory /tmp/ +(cd /tmp/cppcheck-${CPPCHECK_VERSION}/ && make CFGDIR=/tmp/cppcheck-${CPPCHECK_VERSION}/cfg/ > /dev/null) +export PATH="$PATH:/tmp/cppcheck-${CPPCHECK_VERSION}/" diff --git a/.travis/extended_lint_06_script.sh b/.travis/extended_lint_06_script.sh new file mode 100755 index 0000000000..e8228c9c4d --- /dev/null +++ b/.travis/extended_lint_06_script.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2019 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C + +test/lint/extended-lint-all.sh diff --git a/ci/build_src.sh b/ci/build_src.sh index 21458815f9..693363a24b 100755 --- a/ci/build_src.sh +++ b/ci/build_src.sh @@ -28,6 +28,7 @@ if [ "$CHECK_DOC" = 1 ]; then test/lint/check-rpc-mappings.py . # Run all linters test/lint/lint-all.sh + test/lint/extended-lint-all.sh fi ccache --max-size=$CCACHE_SIZE diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp index eb96ccd587..bf2d2d133a 100644 --- a/src/index/blockfilterindex.cpp +++ b/src/index/blockfilterindex.cpp @@ -58,7 +58,7 @@ struct DBHeightKey { int height; DBHeightKey() : height(0) {} - DBHeightKey(int height_in) : height(height_in) {} + explicit DBHeightKey(int height_in) : height(height_in) {} template void Serialize(Stream& s) const @@ -81,7 +81,7 @@ struct DBHeightKey { struct DBHashKey { uint256 hash; - DBHashKey(const uint256& hash_in) : hash(hash_in) {} + explicit DBHashKey(const uint256& hash_in) : hash(hash_in) {} SERIALIZE_METHODS(DBHashKey, obj) { diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index 8047578108..2270f62515 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -243,7 +243,7 @@ public: class RpcHandlerImpl : public Handler { public: - RpcHandlerImpl(const CRPCCommand& command) : m_command(command), m_wrapped_command(&command) + explicit RpcHandlerImpl(const CRPCCommand& command) : m_command(command), m_wrapped_command(&command) { m_command.actor = [this](const JSONRPCRequest& request, UniValue& result, bool last_handler) { if (!m_wrapped_command) return false; diff --git a/src/rpc/util.h b/src/rpc/util.h index 2703e5b5ee..112b160974 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -221,7 +221,7 @@ struct RPCResults { struct RPCExamples { const std::string m_examples; - RPCExamples( + explicit RPCExamples( std::string examples) : m_examples(std::move(examples)) { diff --git a/test/lint/extended-lint-all.sh b/test/lint/extended-lint-all.sh new file mode 100755 index 0000000000..65c51e02f5 --- /dev/null +++ b/test/lint/extended-lint-all.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2019 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# +# This script runs all contrib/devtools/extended-lint-*.sh files, and fails if +# any exit with a non-zero status code. + +# This script is intentionally locale dependent by not setting "export LC_ALL=C" +# in order to allow for the executed lint scripts to opt in or opt out of locale +# dependence themselves. + +set -u + +SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}") +LINTALL=$(basename "${BASH_SOURCE[0]}") + +for f in "${SCRIPTDIR}"/extended-lint-*.sh; do + if [ "$(basename "$f")" != "$LINTALL" ]; then + if ! "$f"; then + echo "^---- failure generated from $f" + exit 1 + fi + fi +done diff --git a/test/lint/extended-lint-cppcheck.sh b/test/lint/extended-lint-cppcheck.sh new file mode 100755 index 0000000000..47df25ba6b --- /dev/null +++ b/test/lint/extended-lint-cppcheck.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2019 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# + +export LC_ALL=C + +ENABLED_CHECKS=( + "Class '.*' has a constructor with 1 argument that is not explicit." + "Struct '.*' has a constructor with 1 argument that is not explicit." +) + +IGNORED_WARNINGS=( + "src/arith_uint256.h:.* Class 'arith_uint256' has a constructor with 1 argument that is not explicit." + "src/arith_uint256.h:.* Class 'base_uint < 256 >' has a constructor with 1 argument that is not explicit." + "src/arith_uint256.h:.* Class 'base_uint' has a constructor with 1 argument that is not explicit." + "src/coins.h:.* Class 'CCoinsViewBacked' has a constructor with 1 argument that is not explicit." + "src/coins.h:.* Class 'CCoinsViewCache' has a constructor with 1 argument that is not explicit." + "src/coins.h:.* Class 'CCoinsViewCursor' has a constructor with 1 argument that is not explicit." + "src/net.h:.* Class 'CNetMessage' has a constructor with 1 argument that is not explicit." + "src/policy/feerate.h:.* Class 'CFeeRate' has a constructor with 1 argument that is not explicit." + "src/prevector.h:.* Class 'const_iterator' has a constructor with 1 argument that is not explicit." + "src/prevector.h:.* Class 'const_reverse_iterator' has a constructor with 1 argument that is not explicit." + "src/prevector.h:.* Class 'iterator' has a constructor with 1 argument that is not explicit." + "src/prevector.h:.* Class 'reverse_iterator' has a constructor with 1 argument that is not explicit." + "src/primitives/block.h:.* Class 'CBlock' has a constructor with 1 argument that is not explicit." + "src/primitives/transaction.h:.* Class 'CTransaction' has a constructor with 1 argument that is not explicit." + "src/protocol.h:.* Class 'CMessageHeader' has a constructor with 1 argument that is not explicit." + "src/qt/guiutil.h:.* Class 'ItemDelegate' has a constructor with 1 argument that is not explicit." + "src/rpc/util.h:.* Struct 'RPCResults' has a constructor with 1 argument that is not explicit." + "src/rpc/util.h:.* style: Struct 'UniValueType' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'AddressDescriptor' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'ComboDescriptor' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'ConstPubkeyProvider' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'PKDescriptor' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'PKHDescriptor' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'RawDescriptor' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'SHDescriptor' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'WPKHDescriptor' has a constructor with 1 argument that is not explicit." + "src/script/descriptor.cpp:.* Class 'WSHDescriptor' has a constructor with 1 argument that is not explicit." + "src/script/script.h:.* Class 'CScript' has a constructor with 1 argument that is not explicit." + "src/script/standard.h:.* Class 'CScriptID' has a constructor with 1 argument that is not explicit." + "src/support/allocators/secure.h:.* Struct 'secure_allocator < char >' has a constructor with 1 argument that is not explicit." + "src/support/allocators/secure.h:.* Struct 'secure_allocator < RNGState >' has a constructor with 1 argument that is not explicit." + "src/support/allocators/secure.h:.* Struct 'secure_allocator < unsigned char >' has a constructor with 1 argument that is not explicit." + "src/support/allocators/zeroafterfree.h:.* Struct 'zero_after_free_allocator < char >' has a constructor with 1 argument that is not explicit." + "src/test/checkqueue_tests.cpp:.* Struct 'FailingCheck' has a constructor with 1 argument that is not explicit." + "src/test/checkqueue_tests.cpp:.* Struct 'MemoryCheck' has a constructor with 1 argument that is not explicit." + "src/test/checkqueue_tests.cpp:.* Struct 'UniqueCheck' has a constructor with 1 argument that is not explicit." + "src/wallet/db.h:.* Class 'BerkeleyEnvironment' has a constructor with 1 argument that is not explicit." +) + +if ! command -v cppcheck > /dev/null; then + echo "Skipping cppcheck linting since cppcheck is not installed. Install by running \"apt install cppcheck\"" + exit 0 +fi + +function join_array { + local IFS="$1" + shift + echo "$*" +} + +ENABLED_CHECKS_REGEXP=$(join_array "|" "${ENABLED_CHECKS[@]}") +IGNORED_WARNINGS_REGEXP=$(join_array "|" "${IGNORED_WARNINGS[@]}") +WARNINGS=$(git ls-files -- "*.cpp" "*.h" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" | \ + xargs cppcheck --enable=all -j "$(getconf _NPROCESSORS_ONLN)" --language=c++ --std=c++11 --template=gcc -D__cplusplus -DCLIENT_VERSION_BUILD -DCLIENT_VERSION_IS_RELEASE -DCLIENT_VERSION_MAJOR -DCLIENT_VERSION_MINOR -DCLIENT_VERSION_REVISION -DCOPYRIGHT_YEAR -DDEBUG -DHAVE_WORKING_BOOST_SLEEP_FOR -I src/ -q 2>&1 | sort -u | \ + grep -E "${ENABLED_CHECKS_REGEXP}" | \ + grep -vE "${IGNORED_WARNINGS_REGEXP}") +if [[ ${WARNINGS} != "" ]]; then + echo "${WARNINGS}" + echo + echo "Advice not applicable in this specific case? Add an exception by updating" + echo "IGNORED_WARNINGS in $0" + # Uncomment to enforce the developer note policy "By default, declare single-argument constructors `explicit`" + # exit 1 +fi +exit 0 From d96680acd2daf98d5fb1d19b4bc6baf5f44ee42c Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 10 Jul 2019 12:21:26 +0200 Subject: [PATCH 2/6] Merge #16338: test: Disable other targets when enable-fuzz is set 84edfc72e5eba3dde824ebd0626e97929a0b1bca Update doc and CI config (qmma) 48bcb2ac249e0e666ce638bb29124558b3283c16 Disable other targets when enable-fuzz is set (qmma) Pull request description: This is to fix https://github.com/bitcoin/bitcoin/issues/16094 When the `enable-fuzz` flag is set, disable all other binary targets. ACKs for top commit: MarcoFalke: ACK 84edfc72e5eba3dde824ebd0626e97929a0b1bca (only checked that travis compiled this) Tree-SHA512: f4ac80526388a67709986b22de88b00bf93ab44ae31a20bd4d8923a4982ab97e015a9f13010081d6ecf6c23ae8afeac7ca9d849d198ce6ebe239aa3127151efc --- .travis.yml | 2 +- configure.ac | 47 +++++++++++++++++++++++++++++++++-------------- doc/fuzzing.md | 4 ++-- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 498a8bcfd6..31ee1922e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -297,7 +297,7 @@ after_success: RUN_FUNCTIONAL_TESTS=false RUN_FUZZ_TESTS=true GOAL="install" - BITCOIN_CONFIG="--disable-wallet --disable-bench --with-utils=no --with-daemon=no --with-libs=no --with-gui=no --enable-fuzz --with-sanitizers=fuzzer,address CC=clang CXX=clang++" + BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,address CC=clang CXX=clang++" - stage: test env: >- diff --git a/configure.ac b/configure.ac index 9cc7ac018c..08e9070465 100644 --- a/configure.ac +++ b/configure.ac @@ -145,7 +145,8 @@ AC_ARG_ENABLE([extended-functional-tests], [use_extended_functional_tests=no]) AC_ARG_ENABLE([fuzz], - AS_HELP_STRING([--enable-fuzz],[enable building of fuzz targets (default no)]), + AS_HELP_STRING([--enable-fuzz], + [enable building of fuzz targets (default no). enabling this will disable all other targets]), [enable_fuzz=$enableval], [enable_fuzz=no]) @@ -1118,6 +1119,37 @@ dnl it would break GCC's #include_next. AC_DEFUN([SUPPRESS_WARNINGS], [$(echo $1 |${SED} -E -e 's/(^| )-I/\1-isystem /g' -e 's;-isystem /usr/include([/ ]|$);-I/usr/include\1;g')]) +dnl enable-fuzz should disable all other targets +if test "x$enable_fuzz" = "xyes"; then + AC_MSG_WARN(enable-fuzz will disable all other targets) + build_bitcoin_utils=no + build_bitcoin_cli=no + build_bitcoin_tx=no + build_bitcoin_wallet=no + build_bitcoind=no + build_bitcoin_libs=no + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + bitcoin_enable_qt_dbus=no + enable_wallet=no + use_bench=no + use_upnp=no + use_zmq=no +else + BITCOIN_QT_INIT + + dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus + BITCOIN_QT_CONFIGURE([5.5.1]) + + dnl Keep a copy of the original $QT_INCLUDES and use it when invoking qt's moc + QT_INCLUDES_UNSUPPRESSED=$QT_INCLUDES + if test x$suppress_external_warnings != xno ; then + QT_INCLUDES=SUPPRESS_WARNINGS($QT_INCLUDES) + QT_DBUS_INCLUDES=SUPPRESS_WARNINGS($QT_DBUS_INCLUDES) + QT_TEST_INCLUDES=SUPPRESS_WARNINGS($QT_TEST_INCLUDES) + fi +fi + if test x$enable_wallet != xno; then dnl Check for libdb_cxx only if wallet enabled BITCOIN_FIND_BDB48 @@ -1155,19 +1187,6 @@ if test x$have_miniupnpc != xno; then fi fi -BITCOIN_QT_INIT - -dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus -BITCOIN_QT_CONFIGURE([5.5.1]) - -dnl Keep a copy of the original $QT_INCLUDES and use it when invoking qt's moc -QT_INCLUDES_UNSUPPRESSED=$QT_INCLUDES -if test x$suppress_external_warnings != xno ; then - QT_INCLUDES=SUPPRESS_WARNINGS($QT_INCLUDES) - QT_DBUS_INCLUDES=SUPPRESS_WARNINGS($QT_DBUS_INCLUDES) - QT_TEST_INCLUDES=SUPPRESS_WARNINGS($QT_TEST_INCLUDES) -fi - if test x$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononononono; then use_boost=no else diff --git a/doc/fuzzing.md b/doc/fuzzing.md index a67f11891e..1d515339fc 100644 --- a/doc/fuzzing.md +++ b/doc/fuzzing.md @@ -52,7 +52,7 @@ For macOS you may need to ignore x86 compilation checks when running `make`: To build Dash Core using AFL instrumentation (this assumes that the `AFLPATH` was set as above): ``` -./configure --disable-ccache --disable-shared --enable-tests --enable-fuzz --disable-wallet --disable-bench --with-utils=no --with-daemon=no --with-libs=no --with-gui=no CC=${AFLPATH}/afl-gcc CXX=${AFLPATH}/afl-g++ +./configure --disable-ccache --disable-shared --enable-tests --enable-fuzz CC=${AFLPATH}/afl-gcc CXX=${AFLPATH}/afl-g++ export AFL_HARDEN=1 make ``` @@ -102,7 +102,7 @@ libFuzzer is needed (all found in the `compiler-rt` runtime libraries package). To build all fuzz targets with libFuzzer, run ``` -./configure --disable-ccache --disable-wallet --disable-bench --with-utils=no --with-daemon=no --with-libs=no --with-gui=no --enable-fuzz --with-sanitizers=fuzzer,address CC=clang CXX=clang++ +./configure --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address CC=clang CXX=clang++ make ``` From 35e8922274af5c6badf8746e27ce3a5276fbf6b9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 10 Jul 2019 12:41:38 +0200 Subject: [PATCH 3/6] Merge #16270: depends: expat 2.2.7 0512f0521a63a4cd65e5e93ac1c44e4d54604605 depends: expat 2.2.7 (fanquake) Pull request description: Major changes in expat 2.2.7: * [#186](https://github.com/libexpat/libexpat/issues/186) [#262](https://github.com/libexpat/libexpat/pull/262) Fix extraction of namespace prefixes from XML names; XML names with multiple colons could end up in the wrong namespace, and take a high amount of RAM and CPU resources while processing, opening the door to use for denial-of-service attacks * [#227](https://github.com/libexpat/libexpat/pull/227) Autotools: Add --without-examples and --without-tests Full changelog is available [here](https://github.com/libexpat/libexpat/blob/R_2_2_7/expat/Changes#L5). ACKs for top commit: laanwj: ACK 0512f0521a63a4cd65e5e93ac1c44e4d54604605 Tree-SHA512: 45162a9b0011107fd59a97dae7b5eb61989dafbec26b1ee497d1b11bf5c6a119971096899caa2998648b82a62db57c629a1560453557146c2496b39a7f3f8de9 --- depends/packages/expat.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/depends/packages/expat.mk b/depends/packages/expat.mk index 8d06882cdb..6de5d41859 100644 --- a/depends/packages/expat.mk +++ b/depends/packages/expat.mk @@ -1,11 +1,11 @@ package=expat -$(package)_version=2.2.6 -$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_6/ +$(package)_version=2.2.7 +$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_7/ $(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2 +$(package)_sha256_hash=cbc9102f4a31a8dafd42d642e9a3aa31e79a0aedaa1f6efd2795ebc83174ec18 define $(package)_set_vars -$(package)_config_opts=--disable-static --without-docbook +$(package)_config_opts=--disable-static --without-docbook --without-tests --without-examples endef define $(package)_config_cmds From 0feb04ab6f1bf21910b6b62f4f1adc5381872790 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 10 Jul 2019 13:31:05 -0400 Subject: [PATCH 4/6] Merge #16361: Remove redundant pre-TopUpKeypool check 96b6dd468a4cb6077d1a2267d620d99d39aac7d0 Remove redundant pre-TopUpKeypool checks (Gregory Sanders) Pull request description: TopUpKeypool already has a quick check for `IsLocked()` ACKs for top commit: achow101: ACK 96b6dd468a4cb6077d1a2267d620d99d39aac7d0 Reviewed the diff and checked that the `if (!IsLocked()) TopUpKeypool()` pattern is changed everywhere. Tree-SHA512: 36f5ae1be611404656ac855763e569fd3b5e932db8170f39ebda74300aa02062774b2c28ce6cf00f2ccc0e3550de58df36efa9097e24f0a51f2809b8a489c95a --- src/wallet/wallet.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a1d6a3ed66..30f1f38031 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4197,8 +4197,7 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize) { LOCK(cs_wallet); - if (IsLocked(true)) - return false; + if (IsLocked(true)) return false; // Top up key pool unsigned int nTargetSize; @@ -4267,8 +4266,7 @@ bool CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRe { LOCK(cs_wallet); - if (!IsLocked(true)) - TopUpKeyPool(); + TopUpKeyPool(); bool fReturningInternal = IsHDEnabled() && fRequestedInternal; std::set& setKeyPool = fReturningInternal ? setInternalKeyPool : setExternalKeyPool; From d1894b1710e8d6cefd8cd59427a9b9df9632a193 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 16 Jul 2019 09:31:40 +0800 Subject: [PATCH 5/6] Merge #16380: Remove unused bits from the service flags enum fa0d0ff6e1bee60fde63724ae28a51aac5a94d4a Remove unused bits from the service flags enum (MarcoFalke) Pull request description: Remove all bits that have no BIP specification nor can be observed on the active network ACKs for top commit: practicalswift: utACK fa0d0ff6e1bee60fde63724ae28a51aac5a94d4a LarryRuane: utACK fa0d0ff6e1bee60fde63724ae28a51aac5a94d4a promag: ACK fa0d0ff6e1bee60fde63724ae28a51aac5a94d4a. laanwj: ACK fa0d0ff6e1bee60fde63724ae28a51aac5a94d4a Tree-SHA512: 6342017bfd4c2a39c998fbb02497931b11892e1cb60fc13b948b91812f281b605a25a3fdc0d5358dff18da4e82eb4eb4de95c43c7e76ecb331c1c3985443dd21 --- src/protocol.cpp | 1 - src/protocol.h | 5 +---- src/qt/guiutil.cpp | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/protocol.cpp b/src/protocol.cpp index fc03795959..dd8da8716a 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -334,7 +334,6 @@ static std::string serviceFlagToStr(size_t bit) case NODE_NETWORK: return "NETWORK"; case NODE_GETUTXO: return "GETUTXO"; case NODE_BLOOM: return "BLOOM"; - case NODE_XTHIN: return "XTHIN"; case NODE_COMPACT_FILTERS: return "COMPACT_FILTERS"; case NODE_NETWORK_LIMITED: return "NETWORK_LIMITED"; // Not using default, so we get warned when a case is missing diff --git a/src/protocol.h b/src/protocol.h index 7bf1e5011d..ca6ac5c7f6 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2015 The Bitcoin Core developers +// Copyright (c) 2009-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -314,9 +314,6 @@ enum ServiceFlags : uint64_t { // Dash Core nodes used to support this by default, without advertising this bit, // but no longer do as of protocol version 70201 (= NO_BLOOM_VERSION) NODE_BLOOM = (1 << 2), - // NODE_XTHIN means the node supports Xtreme Thinblocks - // If this is turned off then the node will not service nor make xthin requests - NODE_XTHIN = (1 << 4), // NODE_COMPACT_FILTERS means the node will service basic block filter requests. // See BIP157 and BIP158 for details on how this is implemented. NODE_COMPACT_FILTERS = (1 << 6), diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index bd0407bbb3..b212acef9e 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -15,10 +15,10 @@ #include #include -#include #include #include #include +#include #include #include