From 1a20c25a0d595b11e414be21d20406c45a46aa15 Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 18 Jun 2020 12:53:15 +0800 Subject: [PATCH 01/26] Merge #19301: build: don't warn when doxygen isn't found fa84edb93c85f7709fc53abf9c6daae5d1bb3b28 build: don't warn when doxygen isn't found (fanquake) Pull request description: Doxygen isn't so important that we need to warn when it is missing. I'd assume it might even be missing more often than not for most builds. ACKs for top commit: MarcoFalke: Fine with me ACK fa84edb93c85f7709fc53abf9c6daae5d1bb3b28 hebasto: ACK fa84edb93c85f7709fc53abf9c6daae5d1bb3b28, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 793ebf01a8a5d48b78a70fdef0022633fca59b30074c960ebb21589e3bd98992b8304621a2d999195d12172ed30fe9eefeeb2a952d58853cf58e8d9902b0090c --- configure.ac | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure.ac b/configure.ac index aaf71d8cb4..599c8d2300 100644 --- a/configure.ac +++ b/configure.ac @@ -110,9 +110,6 @@ AC_PATH_TOOL(CPPFILT, c++filt) AC_PATH_TOOL(OBJCOPY, objcopy) AC_PATH_TOOL(DSYMUTIL, dsymutil) AC_PATH_PROG(DOXYGEN, doxygen) -if test -z "$DOXYGEN"; then - AC_MSG_WARN([Doxygen not found]) -fi AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files) From 3f3bdafd4eec793b2eb6bdaf5fde73ed71fb6d84 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 21 Jun 2020 05:57:48 -0400 Subject: [PATCH 02/26] Merge #19095: [tools] Update clang-format config for multi-line function declarations and calls cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7 [tools] Update clang-format config (John Newbery) Pull request description: In some cases, running clang-format has made code _less_ readable by joining declarations and calls for functions with many arguments into very long lines. For example: ``` - size_t getQueueInfo(std::chrono::system_clock::time_point &first, - std::chrono::system_clock::time_point &last) const; + size_t getQueueInfo(std::chrono::system_clock::time_point& first, std::chrono::system_clock::time_point& last) const; ``` (https://github.com/bitcoin/bitcoin/pull/19090#discussion_r431961148) This change to clang-format would allow arguments/parameters for func declarations/calls to be split over multiple lines, aligned with the opening parens. It does not force args/params to be on new lines (that setting is `BinPackParameters : true`). ACKs for top commit: MarcoFalke: ACK cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7 fine with me practicalswift: ACK cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7 Tree-SHA512: a62474925e71aaff41bdce7960fd5ffd64317da810f694d8084080b054708cf71c2ab2ce3111db5a9260d1c1f9e02d59a2ecb5543b1b6172ce085cb42432160a --- src/.clang-format | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/.clang-format b/src/.clang-format index 19b06a3be9..a8e8ce69fe 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -1,9 +1,10 @@ Language: Cpp AccessModifierOffset: -4 -AlignAfterOpenBracket: false +AlignAfterOpenBracket: true AlignEscapedNewlinesLeft: true AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: false +AllowAllArgumentsOnNextLine : true +AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: true From 26a5c857aa3b04ae1ec38da0be9b7d779c165581 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 1 Jul 2020 19:27:52 -0400 Subject: [PATCH 03/26] Merge bitcoin-core/gui#17: doc: Remove outdated comment in TransactionTablePriv faebb60b8d009e52d585cffd0f124a0f2fd1a66d doc: Remove outdated comment in TransactionTablePriv (MarcoFalke) Pull request description: Locks are no longer taken upfront, so remove the outdated comment ACKs for top commit: hebasto: ACK faebb60b8d009e52d585cffd0f124a0f2fd1a66d, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: cd6df24d49d17e58049ac9b261c5e07c8e85ed1aacb547b13c0e55139339d7fcc3b1f766ea2e27d758ea77deadc01f7e28781be1515323c82b9012cee8fd488b --- src/qt/transactiontablemodel.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 2a996b2577..4f9faf237d 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -193,17 +193,12 @@ public: TransactionRecord *index(interfaces::Wallet& wallet, int numBlocks, int idx) { - if(idx >= 0 && idx < cachedWallet.size()) - { + if (idx >= 0 && idx < cachedWallet.size()) { TransactionRecord *rec = &cachedWallet[idx]; - // Get required locks upfront. This avoids the GUI from getting - // stuck if the core is holding the locks for a longer time - for - // example, during a wallet rescan. - // // If a status update is needed (blocks came in since last check), - // update the status of this transaction from the wallet. Otherwise, - // simply re-use the cached status. + // try to update the status of this transaction from the wallet. + // Otherwise, simply re-use the cached status. interfaces::WalletTxStatus wtx; int64_t adjustedTime; if (rec->statusUpdateNeeded(numBlocks, parent->getChainLockHeight()) && wallet.tryGetTxStatus(rec->hash, wtx, adjustedTime)) { From ee752790cd2fcfff1a8df14c952ea23fadaa780f Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 9 Jul 2020 19:00:17 +0800 Subject: [PATCH 04/26] Merge #19454: tools: `.clang-format` compat with clang versions < 9 b9253c7d2089d3d159dcc10118ce5a219d9a6881 tools: clang-format 6 compatibility (Jon Atack) Pull request description: Our `.clang-format` settings inadvertently lost compatibility with Clang versions < 9 in #19095, including for Debian stable. This patch returns compatibility in the interim until the distros update. See discussion from https://github.com/bitcoin/bitcoin/pull/19095#issuecomment-651926138. ACKs for top commit: MarcoFalke: Approach ACK b9253c7d2089d3d159dcc10118ce5a219d9a6881 , haven't tested Tree-SHA512: 4af541a195f48d84ffb80e23aaefb624c66bc78f087c8d92b4af5a654420b69fedf25272c6e4fde2688ff88412d306b7a990ce1e15d8b24180374c625a253fb6 --- src/.clang-format | 1 - 1 file changed, 1 deletion(-) diff --git a/src/.clang-format b/src/.clang-format index a8e8ce69fe..bedf672b61 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -3,7 +3,6 @@ AccessModifierOffset: -4 AlignAfterOpenBracket: true AlignEscapedNewlinesLeft: true AlignTrailingComments: true -AllowAllArgumentsOnNextLine : true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortFunctionsOnASingleLine: All From 56bf736b680c7cb711942b14e131fdf18272ad89 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 9 Jul 2020 15:07:56 +0200 Subject: [PATCH 05/26] Merge #19468: refactor: Drop unused CDBWrapper methods 4b5ac258812a1e8848862689ff333587cf274892 Drop unused CDBWrapper methods (Hennadii Stepanov) Pull request description: `CDBWrapper::Flush()` and `CDBWrapper::Sync()` are not used in the code. ACKs for top commit: promag: ACK 4b5ac258812a1e8848862689ff333587cf274892. laanwj: ACK 4b5ac258812a1e8848862689ff333587cf274892 Tree-SHA512: 06115c59e75995d496173a64ceea1b9bb1b4fe3eac8bf4f59df68b87b112b5b3e8065298dcd5c4c7408544f76ee62922325acc2208619d830fd5dbb420cdda5c --- src/dbwrapper.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/dbwrapper.h b/src/dbwrapper.h index b900312455..54924578b9 100644 --- a/src/dbwrapper.h +++ b/src/dbwrapper.h @@ -345,18 +345,6 @@ public: // Get an estimate of LevelDB memory usage (in bytes). size_t DynamicMemoryUsage() const; - // not available for LevelDB; provide for compatibility with BDB - bool Flush() - { - return true; - } - - bool Sync() - { - CDBBatch batch(*this); - return WriteBatch(batch, true); - } - CDBIterator *NewIterator() { return new CDBIterator(*this, pdb->NewIterator(iteroptions)); From 959a031bf8fd20b243b75f5aa610e2f0624335c4 Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 9 Jul 2020 22:07:29 +0800 Subject: [PATCH 06/26] Merge #18993: qt: increase console command max length fc6a637a013daeb14b2f93652d7f494f3b8462aa qt: increase console command max length (10xcryptodev) Pull request description: fix #17618 Tested the examples https://github.com/bitcoin/bitcoin/issues/17618#issuecomment-559538070 and works ACKs for top commit: MarcoFalke: Approach ACK fc6a637a013daeb14b2f93652d7f494f3b8462aa hebasto: ACK fc6a637a013daeb14b2f93652d7f494f3b8462aa, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 4975d7fa4c13a6b0f50f5754c3e04eb5a42b1411c385dc883d9948b6fc0dee38900ba2a418218a9a30ce39988a27d22f3ff3a02f0fa44f4136f01eef473efeca --- src/qt/rpcconsole.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 49538b07a2..ceb044ee9e 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -482,6 +482,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, QWidget* parent, Qt::WindowFlags // Install event filter for up and down arrow ui->lineEdit->installEventFilter(this); + ui->lineEdit->setMaxLength(16 * 1024 * 1024); ui->messagesWidget->installEventFilter(this); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); From d4d94dfb1548378bc081030b063e6df4d13110c9 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 9 Jul 2020 20:24:13 +0200 Subject: [PATCH 07/26] Merge #19283: refactor: Remove unused BlockAssembler::pblock member var fa6d5ab67444013f9db696cca2257c871e002594 refactor: Remove unused BlockAssembler::pblock member var (MarcoFalke) Pull request description: It seems odd to have a confusing and fragile "convenience pointer" member variable to be able to write `pblock->vtx` instead of `pblocktemplate->block.vtx` in a single place. ACKs for top commit: promag: Code review ACK fa6d5ab67444013f9db696cca2257c871e002594. Tree-SHA512: e9f032b5ab702dbefffd370db3768ebfb95c13acc732972b695281ea34c91d70cd0a1700bc2c6f106dbc9de68e81bc6bb06c68c2afd53c17cba8ebee4f9931b9 --- src/miner.cpp | 4 ++-- src/miner.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index edfabb526a..03840a0b4c 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -118,7 +118,7 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc if(!pblocktemplate.get()) return nullptr; - pblock = &pblocktemplate->block; // pointer for convenience + CBlock* const pblock = &pblocktemplate->block; // pointer for convenience // Add dummy coinbase tx as first transaction pblock->vtx.emplace_back(); @@ -281,7 +281,7 @@ bool BlockAssembler::TestPackageTransactions(const CTxMemPool::setEntries& packa void BlockAssembler::AddToBlock(CTxMemPool::txiter iter) { - pblock->vtx.emplace_back(iter->GetSharedTx()); + pblocktemplate->block.vtx.emplace_back(iter->GetSharedTx()); pblocktemplate->vTxFees.push_back(iter->GetFee()); pblocktemplate->vTxSigOps.push_back(iter->GetSigOpCount()); nBlockSize += iter->GetTxSize(); diff --git a/src/miner.h b/src/miner.h index f9de50e35f..942063f66d 100644 --- a/src/miner.h +++ b/src/miner.h @@ -129,8 +129,6 @@ class BlockAssembler private: // The constructed block template std::unique_ptr pblocktemplate; - // A convenience pointer that always refers to the CBlock in pblocktemplate - CBlock* pblock; // Configuration parameters for the block size unsigned int nBlockMaxSize; From 4e21052645979872d8963ba55965b28afa550f1b Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 21 Jul 2020 11:28:33 +0200 Subject: [PATCH 08/26] Merge #18984: Remove unnecessary input blockfile SetPos 5fa067a27d709a8a24b798cbd2459bf5b291c885 Remove unnecessary blockfile SetPos (Tom Harding) Pull request description: Nothing could have changed the position since we retrieved it a few statements earlier. This dates from commit 16d5194165c8c83492b95f431a664d98c40ff254. ACKs for top commit: LarryRuane: ACK 5fa067a27d709a8a24b798cbd2459bf5b291c885 Tree-SHA512: 459cc7226e186c231ffb67f0613f550e8eb940f1b8933c3bc4a4e8dd519c8d5d45884e8cfd9347039dab90a093644bbbb31be063baed1c6fc7984b6cb4f17c9f --- src/validation.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index d9910c0257..d469e0b312 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4877,7 +4877,6 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB if (dbp) dbp->nPos = nBlockPos; blkdat.SetLimit(nBlockPos + nSize); - blkdat.SetPos(nBlockPos); std::shared_ptr pblock = std::make_shared(); CBlock& block = *pblock; blkdat >> block; From ca2d095489c930afc94ba7b29d354cda7e230918 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 24 Jul 2020 08:15:42 +0800 Subject: [PATCH 09/26] Merge #19565: build: call AC_PATH_TOOL for dsymutil in macOS cross-compile ef3d4ce4c301caa57946f772f554678cd872fca8 build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing #19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce4c301caa57946f772f554678cd872fca8 theuni: ACK ef3d4ce4c301caa57946f772f554678cd872fca8. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466 --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 599c8d2300..b6047f8cf4 100644 --- a/configure.ac +++ b/configure.ac @@ -631,6 +631,7 @@ case $host in BUILD_OS=darwin ;; *) + AC_PATH_TOOL([DSYMUTIL], [dsymutil], dsymutil) AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) AC_PATH_TOOL([OTOOL], [otool], otool) AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) From 7a92af887d13a785925734ee90d25e979e6035e5 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 30 Jul 2020 17:32:33 +0200 Subject: [PATCH 10/26] Merge #19439: script: Linter to check commit message formatting 284a969cc082ae3c63ab523f22e71da86ad4ab20 Linter to check commit message formatting (Amir Ghorbanian) Pull request description: Write linter to check that commit messages have a new line before the body or no body at all. fixes issue #19091. ACKs for top commit: troygiorshev: ACK 284a969cc082ae3c63ab523f22e71da86ad4ab20 Reviewed, manually tested. Works great! fjahr: tested ACK 284a969cc082ae3c63ab523f22e71da86ad4ab20 adamjonas: utACK 284a969cc082ae3c63ab523f22e71da86ad4ab20 Tree-SHA512: fa278f090780b54e4fa6e2967a62b4c1a4da55d112ec1ad6dd7e1181ac490c5c1af0165524b5781b463fdd6d0f79fd3d95b5160184e6eca432ccff1189f77390 --- test/lint/lint-git-commit-check.sh | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 test/lint/lint-git-commit-check.sh diff --git a/test/lint/lint-git-commit-check.sh b/test/lint/lint-git-commit-check.sh new file mode 100755 index 0000000000..7cffd267dd --- /dev/null +++ b/test/lint/lint-git-commit-check.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# Copyright (c) 2020 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# +# Linter to check that commit messages have a new line before the body +# or no body at all + +export LC_ALL=C + +EXIT_CODE=0 + +while getopts "?" opt; do + case $opt in + ?) + echo "Usage: $0 [N]" + echo " TRAVIS_COMMIT_RANGE='' $0" + echo " $0 -?" + echo "Checks unmerged commits, the previous N commits, or a commit range." + echo "TRAVIS_COMMIT_RANGE='47ba2c3...ee50c9e' $0" + exit ${EXIT_CODE} + ;; + esac +done + +if [ -z "${TRAVIS_COMMIT_RANGE}" ]; then + if [ -n "$1" ]; then + TRAVIS_COMMIT_RANGE="HEAD~$1...HEAD" + else + TRAVIS_COMMIT_RANGE="origin/master..HEAD" + fi +fi + +while IFS= read -r commit_hash || [[ -n "$commit_hash" ]]; do + n_line=0 + while IFS= read -r line || [[ -n "$line" ]]; do + n_line=$((n_line+1)) + length=${#line} + if [ $n_line -eq 2 ] && [ $length -ne 0 ]; then + echo "The subject line of commit hash ${commit_hash} is followed by a non-empty line. Subject lines should always be followed by a blank line." + EXIT_CODE=1 + fi + done < <(git log --format=%B -n 1 "$commit_hash") +done < <(git log "${TRAVIS_COMMIT_RANGE}" --format=%H) + +exit ${EXIT_CODE} From 413122de23747b5995fffbec3d5e3d8addbb8545 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 2 Aug 2020 12:42:23 +0200 Subject: [PATCH 11/26] Merge #19639: doc: Remove Reference Links #19582 334de75885dd0fb1ca51c6ec4536d9f665957095 scripted-diff: Remove Reference Links (Robert) Pull request description: Removed all reference links. Found this issue from #19582. The decision to remove links instead of update them was made in #19584 The author of that PR was slow to resolve his commit to use scripted diff so I made this PR instead. ACKs for top commit: laanwj: ACK 334de75885dd0fb1ca51c6ec4536d9f665957095 MarcoFalke: ACK 334de75885dd0fb1ca51c6ec4536d9f665957095 Tree-SHA512: a337116379912b27974867bd86ec7799a1d41d67b51771885467fbe1be003b415cb37ce8e521568bf3eae190ab2f6af0d6e29fd3ea25f2689b8fb31def8fec96 --- src/protocol.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/protocol.h b/src/protocol.h index b56bdf1fc7..e69fe44c63 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -60,19 +60,16 @@ namespace NetMsgType { /** * The version message provides information about the transmitting node to the * receiving node at the beginning of a connection. - * @see https://bitcoin.org/en/developer-reference#version */ extern const char *VERSION; /** * The verack message acknowledges a previously-received version message, * informing the connecting node that it can begin to send other messages. - * @see https://bitcoin.org/en/developer-reference#verack */ extern const char *VERACK; /** * The addr (IP address) message relays connection information for peers on the * network. - * @see https://bitcoin.org/en/developer-reference#addr */ extern const char *ADDR; /** @@ -90,82 +87,69 @@ extern const char *SENDADDRV2; /** * The inv message (inventory message) transmits one or more inventories of * objects known to the transmitting peer. - * @see https://bitcoin.org/en/developer-reference#inv */ extern const char *INV; /** * The getdata message requests one or more data objects from another node. - * @see https://bitcoin.org/en/developer-reference#getdata */ extern const char *GETDATA; /** * The merkleblock message is a reply to a getdata message which requested a * block using the inventory type MSG_MERKLEBLOCK. * @since protocol version 70001 as described by BIP37. - * @see https://bitcoin.org/en/developer-reference#merkleblock */ extern const char *MERKLEBLOCK; /** * The getblocks message requests an inv message that provides block header * hashes starting from a particular point in the block chain. - * @see https://bitcoin.org/en/developer-reference#getblocks */ extern const char *GETBLOCKS; /** * The getheaders message requests a headers message that provides block * headers starting from a particular point in the block chain. * @since protocol version 31800. - * @see https://bitcoin.org/en/developer-reference#getheaders */ extern const char *GETHEADERS; /** * The tx message transmits a single transaction. - * @see https://bitcoin.org/en/developer-reference#tx */ extern const char *TX; /** * The headers message sends one or more block headers to a node which * previously requested certain headers with a getheaders message. * @since protocol version 31800. - * @see https://bitcoin.org/en/developer-reference#headers */ extern const char *HEADERS; /** * The block message transmits a single serialized block. - * @see https://bitcoin.org/en/developer-reference#block */ extern const char *BLOCK; /** * The getaddr message requests an addr message from the receiving node, * preferably one with lots of IP addresses of other receiving nodes. - * @see https://bitcoin.org/en/developer-reference#getaddr */ extern const char *GETADDR; /** * The mempool message requests the TXIDs of transactions that the receiving * node has verified as valid but which have not yet appeared in a block. * @since protocol version 60002. - * @see https://bitcoin.org/en/developer-reference#mempool */ extern const char *MEMPOOL; /** * The ping message is sent periodically to help confirm that the receiving * peer is still connected. - * @see https://bitcoin.org/en/developer-reference#ping */ extern const char *PING; /** * The pong message replies to a ping message, proving to the pinging node that * the ponging node is still alive. * @since protocol version 60001 as described by BIP31. - * @see https://bitcoin.org/en/developer-reference#pong */ extern const char *PONG; /** * The notfound message is a reply to a getdata message which requested an * object the receiving node does not have available for relay. * @since protocol version 70001. - * @see https://bitcoin.org/en/developer-reference#notfound */ extern const char *NOTFOUND; /** @@ -174,7 +158,6 @@ extern const char *NOTFOUND; * @since protocol version 70001 as described by BIP37. * Only available with service bit NODE_BLOOM since protocol version * 70011 as described by BIP111. - * @see https://bitcoin.org/en/developer-reference#filterload */ extern const char *FILTERLOAD; /** @@ -183,7 +166,6 @@ extern const char *FILTERLOAD; * @since protocol version 70001 as described by BIP37. * Only available with service bit NODE_BLOOM since protocol version * 70011 as described by BIP111. - * @see https://bitcoin.org/en/developer-reference#filteradd */ extern const char *FILTERADD; /** @@ -192,7 +174,6 @@ extern const char *FILTERADD; * @since protocol version 70001 as described by BIP37. * Only available with service bit NODE_BLOOM since protocol version * 70011 as described by BIP111. - * @see https://bitcoin.org/en/developer-reference#filterclear */ extern const char *FILTERCLEAR; /** @@ -206,7 +187,6 @@ extern const char *REJECT; * Indicates that a node prefers to receive new block announcements via a * "headers" message rather than an "inv". * @since protocol version 70012 as described by BIP130. - * @see https://bitcoin.org/en/developer-reference#sendheaders */ extern const char *SENDHEADERS; From fb7b4bbdcaea9121735a011d7c26944c24e7fe21 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 5 Aug 2020 10:45:30 +0200 Subject: [PATCH 12/26] Merge #19654: lint: Don't use TRAVIS_COMMIT_RANGE in commit message linter 72351784b3df21a89f79076f4b814a6e700b6469 lint: Remove travis env var from commit linter (Fabian Jahr) Pull request description: #19439 was recently merged and seemed to work fine but I now noticed strange behavior when it was running in Travis, which I could not reproduce locally. It turns out `TRAVIS_COMMIT_RANGE` which is used in Travis to get the commits for the linter, uses all the commits that were in a push, which includes all rebase commits for example. This means that the linter can fail on a commit that the developer has never even seen before, which can be very confusing. See an example here which caused me to look into this: https://travis-ci.org/github/bitcoin/bitcoin/jobs/714296381 The commit that is reported as failing in my PR is not part of my PR. I think we rather want to use something like `git merge-base` to get the commit range by default and in Travis. I am leaving the env variable functionality in place with a different name but this is not a variable that can be expected to be present in the CI environments so the `merge-base` range should be used there by default. ACKs for top commit: hebasto: ACK 72351784b3df21a89f79076f4b814a6e700b6469, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: afb27bb386855cb8d5cf84fd3a6c11ef1160b25af6175ed0aa146bf04b9a26eb77298df70df0a855f8c46f19f08b3f62c49872c12974fcfa5526a15ee05b3c10 --- test/lint/lint-git-commit-check.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/lint/lint-git-commit-check.sh b/test/lint/lint-git-commit-check.sh index 7cffd267dd..8947f67bf6 100755 --- a/test/lint/lint-git-commit-check.sh +++ b/test/lint/lint-git-commit-check.sh @@ -14,21 +14,22 @@ while getopts "?" opt; do case $opt in ?) echo "Usage: $0 [N]" - echo " TRAVIS_COMMIT_RANGE='' $0" + echo " COMMIT_RANGE='' $0" echo " $0 -?" echo "Checks unmerged commits, the previous N commits, or a commit range." - echo "TRAVIS_COMMIT_RANGE='47ba2c3...ee50c9e' $0" + echo "COMMIT_RANGE='47ba2c3...ee50c9e' $0" exit ${EXIT_CODE} ;; esac done -if [ -z "${TRAVIS_COMMIT_RANGE}" ]; then - if [ -n "$1" ]; then - TRAVIS_COMMIT_RANGE="HEAD~$1...HEAD" - else - TRAVIS_COMMIT_RANGE="origin/master..HEAD" - fi +if [ -z "${COMMIT_RANGE}" ]; then + if [ -n "$1" ]; then + COMMIT_RANGE="HEAD~$1...HEAD" + else + MERGE_BASE=$(git merge-base HEAD master) + COMMIT_RANGE="$MERGE_BASE..HEAD" + fi fi while IFS= read -r commit_hash || [[ -n "$commit_hash" ]]; do @@ -41,6 +42,6 @@ while IFS= read -r commit_hash || [[ -n "$commit_hash" ]]; do EXIT_CODE=1 fi done < <(git log --format=%B -n 1 "$commit_hash") -done < <(git log "${TRAVIS_COMMIT_RANGE}" --format=%H) +done < <(git log "${COMMIT_RANGE}" --format=%H) exit ${EXIT_CODE} From 3c79f6120f3fdbf2967769d8381bb0bb2b4c24ec Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 10 Aug 2020 20:56:12 +0800 Subject: [PATCH 13/26] Merge #17563: lib: fix a compiler warning: unused GetDevURandom() ca2e47437277ef6851a739f247b44e73a53f21a1 Fix a compiler warning: unused GetDevURandom() (Vasil Dimov) Pull request description: ~~Only define GetDevURandom() if it is going to be used.~~ Silence by planting a dummy reference to the `GetDevURandom` symbol in the places where we don't call the function. ACKs for top commit: practicalswift: ACK ca2e47437277ef6851a739f247b44e73a53f21a1 -- increased signal to noise in compiler diagnostics is good sipa: utACK ca2e47437277ef6851a739f247b44e73a53f21a1 hebasto: re-ACK ca2e47437277ef6851a739f247b44e73a53f21a1, tested on macOS 10.15.6 + llvm clang 10.0.0 Tree-SHA512: 03c98f00dad5d9a3c5c9f68553d72ad5489ec02f18b9769108a22003ec7be7819a731b1eab6a9f64dafb5be0efddccf6980de7e3bb90cd20d4f4d72f74124675 --- src/random.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/random.cpp b/src/random.cpp index fee378f715..1f2e650af3 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -245,6 +245,8 @@ void GetOSRand(unsigned char *ent32) if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) { RandFailure(); } + // Silence a compiler warning about unused function. + (void)GetDevURandom; #elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX) // We need a fallback for OSX < 10.12 if (&getentropy != nullptr) { @@ -254,6 +256,8 @@ void GetOSRand(unsigned char *ent32) } else { GetDevURandom(ent32); } + // Silence a compiler warning about unused function. + (void)GetDevURandom; #elif defined(HAVE_SYSCTL_ARND) /* FreeBSD and similar. It is possible for the call to return less * bytes than requested, so need to read in a loop. @@ -267,6 +271,8 @@ void GetOSRand(unsigned char *ent32) } have += len; } while (have < NUM_OS_RANDOM_BYTES); + // Silence a compiler warning about unused function. + (void)GetDevURandom; #else /* Fall back to /dev/urandom if there is no specific method implemented to * get system entropy for this OS. From 1382c881dfba3d107f4f5a31411776f82ff35d18 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 21 Aug 2020 14:33:41 +0200 Subject: [PATCH 14/26] Merge #19722: test: Add test for getblockheader verboseness 5067c5acc30c5cf87496c1bf8eb03712cc66b206 [test] Add test for getblockheader verboseness (Torhte Butler) Pull request description: Improve test coverage by adding a test for getblockheader with verbose argument set to false. ACKs for top commit: theStack: ACK https://github.com/bitcoin/bitcoin/pull/19722/commits/5067c5acc30c5cf87496c1bf8eb03712cc66b206 Tree-SHA512: e55593f1026a89dc7b796fa985b4cbcdb596e91d80d42dfb0660bda1692aaa35749ec29f9cd7032803f6225afb323f085df1ef6a9982de87be8e098f7253cdd5 --- test/functional/rpc_blockchain.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 5217fb9bda..6560096e6c 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -37,6 +37,8 @@ from test_framework.blocktools import ( create_coinbase, ) from test_framework.messages import ( + CBlockHeader, + FromHex, msg_block, ) from test_framework.mininode import ( @@ -234,6 +236,14 @@ class BlockchainTest(BitcoinTestFramework): assert isinstance(int(header['versionHex'], 16), int) assert isinstance(header['difficulty'], Decimal) + # Test with verbose=False, which should return the header as hex. + header_hex = node.getblockheader(blockhash=besthash, verbose=False) + assert_is_hex_string(header_hex) + + header = FromHex(CBlockHeader(), header_hex) + header.calc_sha256() + assert_equal(header.hash, besthash) + def _test_getdifficulty(self): difficulty = self.nodes[0].getdifficulty() # 1 hash in 2 should be valid, so difficulty should be 1/2**31 From 68f8cbf043a30b72e2b736eb8f29d7ad87ada9a6 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 24 Aug 2020 21:27:19 +0800 Subject: [PATCH 15/26] Merge #17396: build: modest Android improvements 366913e307d2dc13bc00d6bf7b6b2426c359ac30 build: AX_BOOST_THREAD serial 33 (Igor Cota) cf0681133ae7301ead7091eaee55c945da5cdfcc build: disable D-Bus on Android by default (Igor Cota) Pull request description: I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust: - disable D-Bus (Android doesn't support it and has its own way to trigger notifications) - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread) - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~ I think these are small and fairly straightforward so I put them all into this one PR. ACKs for top commit: fanquake: ACK 366913e307d2dc13bc00d6bf7b6b2426c359ac30 Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0 --- build-aux/m4/ax_boost_thread.m4 | 54 ++++++++++++++++++++++++--------- build-aux/m4/bitcoin_qt.m4 | 11 ++++++- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/build-aux/m4/ax_boost_thread.m4 b/build-aux/m4/ax_boost_thread.m4 index e9dea43535..75e80e6e75 100644 --- a/build-aux/m4/ax_boost_thread.m4 +++ b/build-aux/m4/ax_boost_thread.m4 @@ -30,7 +30,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 32 +#serial 33 AC_DEFUN([AX_BOOST_THREAD], [ @@ -67,13 +67,24 @@ AC_DEFUN([AX_BOOST_THREAD], [AC_LANG_PUSH([C++]) CXXFLAGS_SAVE=$CXXFLAGS - if test "x$host_os" = "xsolaris" ; then - CXXFLAGS="-pthreads $CXXFLAGS" - elif test "x$host_os" = "xmingw32" ; then - CXXFLAGS="-mthreads $CXXFLAGS" - else - CXXFLAGS="-pthread $CXXFLAGS" - fi + case "x$host_os" in + xsolaris ) + CXXFLAGS="-pthreads $CXXFLAGS" + break; + ;; + xmingw32 ) + CXXFLAGS="-mthreads $CXXFLAGS" + break; + ;; + *android* ) + break; + ;; + * ) + CXXFLAGS="-pthread $CXXFLAGS" + break; + ;; + esac + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM( [[@%:@include ]], @@ -84,13 +95,23 @@ AC_DEFUN([AX_BOOST_THREAD], AC_LANG_POP([C++]) ]) if test "x$ax_cv_boost_thread" = "xyes"; then - if test "x$host_os" = "xsolaris" ; then - BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" - elif test "x$host_os" = "xmingw32" ; then - BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" - else - BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" - fi + case "x$host_os" in + xsolaris ) + BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" + break; + ;; + xmingw32 ) + BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" + break; + ;; + *android* ) + break; + ;; + * ) + BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" + break; + ;; + esac AC_SUBST(BOOST_CPPFLAGS) @@ -148,6 +169,9 @@ AC_DEFUN([AX_BOOST_THREAD], xmingw32 ) break; ;; + *android* ) + break; + ;; * ) BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread" break; diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index 1d7626ab6a..c4641592d4 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -79,10 +79,19 @@ AC_DEFUN([BITCOIN_QT_INIT],[ AC_ARG_WITH([qtdbus], [AS_HELP_STRING([--with-qtdbus], - [enable DBus support (default is yes if qt is enabled and QtDBus is found)])], + [enable DBus support (default is yes if qt is enabled and QtDBus is found, except on Android)])], [use_dbus=$withval], [use_dbus=auto]) + dnl Android doesn't support D-Bus and certainly doesn't use it for notifications + case $host in + *android*) + if test "x$use_dbus" != xyes; then + use_dbus=no + fi + ;; + esac + AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path) ]) From cd741d0d4d1153bc2d564c62256f895b647dbf39 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 27 Aug 2020 20:32:57 +0200 Subject: [PATCH 16/26] Merge bitcoin-core/gui#40: Clarify block height label b6dcc6d74186eee15eda2cb6e8a7ab5b5b4a05f8 gui: Clarify block height label (Hennadii Stepanov) Pull request description: Prefer "block height" instead of "number of blocks". This was done while testing https://github.com/bitcoin/bitcoin/pull/16981. ACKs for top commit: michaelfolkson: ACK b6dcc6d74186eee15eda2cb6e8a7ab5b5b4a05f8. I don't think there are any other obvious examples in the GUI where "block height" should replace "number of blocks" except for translations. MarcoFalke: cr ACK b6dcc6d74186eee15eda2cb6e8a7ab5b5b4a05f8 Tree-SHA512: ec3b48c1af5d613ed657ad51f2caddea774376736ecc02343d54518986e35ec37f1745b059814b5be92b5e5c2bb2970d17159b24c6e88b9316803d4de5327c31 --- src/qt/forms/debugwindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index d91b5ca95f..39cbd834dd 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -307,7 +307,7 @@ - Current number of blocks + Current block height From f742025444b158458f23a4aac819e7cbc79f52e3 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 28 Aug 2020 19:21:02 +0800 Subject: [PATCH 17/26] Merge #19822: chain: Fix CChain comparison UB by removing it (it was unused) df536883d263781c2abe944afc85f681cda635ed chain: Remove UB CChain comparison (Carl Dong) Pull request description: Comparing two empty `CChain`s is currently undefined behaviour, and resulted in false assertion failures when comparing identical empty `CChain`s in local testing. Let's just remove this comparison operator since it doesn't seem to be used anywhere. ACKs for top commit: practicalswift: ACK df536883d263781c2abe944afc85f681cda635ed -- patch is guaranteed to be correct :) MarcoFalke: cr ACK df536883d263781c2abe944afc85f681cda635ed Tree-SHA512: db10bac364fc965b56abf7a5bac48018786b14806ffe107e3e8eb24d5004a29331f3387dfe3409a3452a6750d3329e3f354265d787ebb3abfccabe77b28a54d5 --- src/chain.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/chain.h b/src/chain.h index 1daf9b9e4c..8e7d67ace8 100644 --- a/src/chain.h +++ b/src/chain.h @@ -424,12 +424,6 @@ public: return vChain[nHeight]; } - /** Compare two chains efficiently. */ - friend bool operator==(const CChain &a, const CChain &b) { - return a.vChain.size() == b.vChain.size() && - a.vChain[a.vChain.size() - 1] == b.vChain[b.vChain.size() - 1]; - } - /** Efficiently check whether a block is present in this chain. */ bool Contains(const CBlockIndex *pindex) const { return (*this)[pindex->nHeight] == pindex; From a33d38dbc51f033e6bb2ac2ec17354928ce9edb6 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 28 Aug 2020 19:47:10 +0800 Subject: [PATCH 18/26] Merge #19758: Drop deprecated and unused GUARDED_VAR and PT_GUARDED_VAR annotations 9034f6e30ee6d3db71049de4500e7ede648557fb Drop deprecated and unused GUARDED_VAR and PT_GUARDED_VAR annotations (Hennadii Stepanov) Pull request description: https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#guarded-var-and-pt-guarded-var: > `GUARDED_VAR` and `PT_GUARDED_VAR` > Use of these attributes has been deprecated. ACKs for top commit: MarcoFalke: ACK 9034f6e30ee6d3db71049de4500e7ede648557fb They seem to be deprecated for a long time already https://releases.llvm.org/4.0.0/tools/clang/docs/ThreadSafetyAnalysis.html#guarded-var-and-pt-guarded-var Tree-SHA512: d86f55fe57c28d91eda4a0ad727e36a5b35ba4b50a557c59b83cf0c5291cc5ad37b6f4ba6daeba3c1aba143faadaea6bb21c723f4d221856d6e6c42d228e8aa2 --- src/threadsafety.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/threadsafety.h b/src/threadsafety.h index f52d5a0367..6c86e5da09 100644 --- a/src/threadsafety.h +++ b/src/threadsafety.h @@ -18,9 +18,7 @@ #define LOCKABLE __attribute__((lockable)) #define SCOPED_LOCKABLE __attribute__((scoped_lockable)) #define GUARDED_BY(x) __attribute__((guarded_by(x))) -#define GUARDED_VAR __attribute__((guarded_var)) #define PT_GUARDED_BY(x) __attribute__((pt_guarded_by(x))) -#define PT_GUARDED_VAR __attribute__((pt_guarded_var)) #define ACQUIRED_AFTER(...) __attribute__((acquired_after(__VA_ARGS__))) #define ACQUIRED_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__))) #define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__((exclusive_lock_function(__VA_ARGS__))) @@ -33,14 +31,12 @@ #define EXCLUSIVE_LOCKS_REQUIRED(...) __attribute__((exclusive_locks_required(__VA_ARGS__))) #define SHARED_LOCKS_REQUIRED(...) __attribute__((shared_locks_required(__VA_ARGS__))) #define NO_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis)) -#define ASSERT_EXCLUSIVE_LOCK(...) __attribute((assert_exclusive_lock(__VA_ARGS__))) +#define ASSERT_EXCLUSIVE_LOCK(...) __attribute__((assert_exclusive_lock(__VA_ARGS__))) #else #define LOCKABLE #define SCOPED_LOCKABLE #define GUARDED_BY(x) -#define GUARDED_VAR #define PT_GUARDED_BY(x) -#define PT_GUARDED_VAR #define ACQUIRED_AFTER(...) #define ACQUIRED_BEFORE(...) #define EXCLUSIVE_LOCK_FUNCTION(...) From 5dc39741e93395e65accbc3b44cb61e6d27dcc7f Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 28 Aug 2020 17:51:33 +0200 Subject: [PATCH 19/26] Merge #19797: net: Remove old check for 3-byte shifted IP addresses from pre-0.2.9 nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7b6d0f10a7af7998f7cfcf3aeaa0269b61a321ce Remove old check for 3-byte shifted IP addresses from pre-0.2.9 node messages (Raúl Martínez (RME)) Pull request description: The change removes an old check for IPv6 addresses in range ::ff:ff00:0:0:0/72 that were created due to a bug in size field of addr messages for 0.2.8 nodes and before. This check is no longer needed as they are no more pre 0.2.9 nodes on the network (as per bitnodes network snapshot). Credits for discovering this go to sipa in https://github.com/bitcoin/bitcoin/pull/19628#discussion_r475907453 Thanks for the attention! ACKs for top commit: sipa: utACK 7b6d0f10a7af7998f7cfcf3aeaa0269b61a321ce vasild: ACK 7b6d0f1 Tree-SHA512: c5fab59dda2acafe143f607a4c5b636a54ac76fba651cad1ad1b09c94e88ab39503a31c2244c8f2664da68456c2a870c601d8894139c55cde9ece8161913ed2e --- src/netaddress.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/netaddress.cpp b/src/netaddress.cpp index 4d43550ba8..9bdcd42c99 100644 --- a/src/netaddress.cpp +++ b/src/netaddress.cpp @@ -419,17 +419,6 @@ bool CNetAddr::IsLocal() const bool CNetAddr::IsValid() const { - // Cleanup 3-byte shifted addresses caused by garbage in size field - // of addr messages from versions before 0.2.9 checksum. - // Two consecutive addr messages look like this: - // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26... - // so if the first length field is garbled, it reads the second batch - // of addr misaligned by 3 bytes. - if (IsIPv6() && memcmp(m_addr.data(), IPV4_IN_IPV6_PREFIX.data() + 3, - sizeof(IPV4_IN_IPV6_PREFIX) - 3) == 0) { - return false; - } - // unspecified IPv6 address (::/128) unsigned char ipNone6[16] = {}; if (IsIPv6() && memcmp(m_addr.data(), ipNone6, sizeof(ipNone6)) == 0) { From a560d32f8c5e7e5455433735cbb1f14f89324270 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 28 Aug 2020 17:53:57 +0200 Subject: [PATCH 20/26] Merge bitcoin-core/gui#39: Add visual accenting for the 'Create new receiving address' button 4ec49f8d1e25b330e6a0f79ae897d98d29ff32f9 qt: Leverage the default "Create new receiving address" button (Hennadii Stepanov) 4227a8e1f3a4f94a5a4cb7adeecf967e14156bde qt: Make "Create new receiving address" default unconditionally (Hennadii Stepanov) Pull request description: Fix #24 The first commit: - visual improvement with no behavior change The second commit: - removes a bunch of LOCs - slightly change behavior and makes it standard With this PR: ![DeepinScreenshot_select-area_20200721213040](https://user-images.githubusercontent.com/32963518/88093294-7b2a6700-cb9a-11ea-89a2-a0e2678056a7.png) ACKs for top commit: Saibato: Concept tACK https://github.com/bitcoin-core/gui/pull/39/commits/4227a8e1f3a4f94a5a4cb7adeecf967e14156bde https://github.com/bitcoin-core/gui/pull/39/commits/4ec49f8d1e25b330e6a0f79ae897d98d29ff32f9 promag: Tested ACK 4ec49f8d1e25b330e6a0f79ae897d98d29ff32f9 on macos. Tree-SHA512: 3403d5ee96ec139491c7e23b24a24d9239fe55c58d99cbd4cd13bc877f76f992ed011c09e2af35b2a63be1a2371b95f6ac719325396dcc8333cf3eb7fa2e3d2c --- src/qt/forms/receivecoinsdialog.ui | 6 ++++++ src/qt/receivecoinsdialog.cpp | 16 ---------------- src/qt/receivecoinsdialog.h | 3 --- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui index e7bc2a7bdd..2915a44871 100644 --- a/src/qt/forms/receivecoinsdialog.ui +++ b/src/qt/forms/receivecoinsdialog.ui @@ -110,6 +110,12 @@ &Request payment + + false + + + true + diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index a1a2f753b3..44c80014e0 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -194,22 +194,6 @@ void ReceiveCoinsDialog::resizeEvent(QResizeEvent *event) columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message); } -void ReceiveCoinsDialog::keyPressEvent(QKeyEvent *event) -{ - if (event->key() == Qt::Key_Return) - { - // press return -> submit form - if (ui->reqLabel->hasFocus() || ui->reqAmount->hasFocus() || ui->reqMessage->hasFocus()) - { - event->ignore(); - on_receiveButton_clicked(); - return; - } - } - - this->QDialog::keyPressEvent(event); -} - QModelIndex ReceiveCoinsDialog::selectedRow() { if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel()) diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h index b3cbc33462..12a9762d7b 100644 --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -48,9 +48,6 @@ public Q_SLOTS: void reject() override; void accept() override; -protected: - virtual void keyPressEvent(QKeyEvent *event) override; - private: Ui::ReceiveCoinsDialog *ui; GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; From 64c0ce9401242e37b2a2c3ff4b4141d9010f7a52 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 5 Sep 2020 13:43:33 +0200 Subject: [PATCH 21/26] Merge #19852: refactor: Avoid duplicate map lookup in ScriptToAsmStr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ac2ff4fb1e06270cf17727f90599c9f3a55ddd5a refactor: Avoid duplicate map lookup in ScriptToAsmStr (João Barbosa) Pull request description: Simple change that avoids a duplicate (unnecessary) `mapSigHashTypes` lookup. ACKs for top commit: laanwj: re-ACK ac2ff4fb1e06270cf17727f90599c9f3a55ddd5a Tree-SHA512: 7e7f5af51c1acd7a42af273e5ee5e2faddd250ba8b8f63ccb3172d95f153ae391b2816b79564b856571af52dc2a767b5736a5d10ffb5cd2c540cd9832bf86419 --- src/core_write.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core_write.cpp b/src/core_write.cpp index d478d09906..5a36ced213 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -120,8 +120,9 @@ std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDeco // checks in CheckSignatureEncoding. if (CheckSignatureEncoding(vch, SCRIPT_VERIFY_STRICTENC, nullptr)) { const unsigned char chSigHashType = vch.back(); - if (mapSigHashTypes.count(chSigHashType)) { - strSigHashDecode = "[" + mapSigHashTypes.find(chSigHashType)->second + "]"; + const auto it = mapSigHashTypes.find(chSigHashType); + if (it != mapSigHashTypes.end()) { + strSigHashDecode = "[" + it->second + "]"; vch.pop_back(); // remove the sighash type byte. it will be replaced by the decode. } } From fdc99dcc646c813b6d0bf6d312d663ea2412fbda Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 5 Sep 2020 14:07:52 +0200 Subject: [PATCH 22/26] Merge #19728: Increase the ip address relay branching factor for unreachable networks 86d4cf42d97abf4c436d1eabf29e2ed150f69c1e Increase the ip address relay branching factor for unreachable networks (Pieter Wuille) Pull request description: Onion addresses propagate very badly among the IPv4/IPv6 network, resulting in difficulty for those to find each other. The branching factor 1 is probably so low that propagations die out before they reach another onion peer. Increase it to 1.5 on average. ACKs for top commit: practicalswift: ACK 86d4cf42d97abf4c436d1eabf29e2ed150f69c1e -- patch looks correct naumenkogs: ACK 86d4cf4 jonatack: ACK 86d4cf42d97abf4c436d1eabf29e2ed150f69c1e. Code review, built and running with some sanity check logging. `RelayAddress()` is called by `ProcessMessage() ADDR` msg handling, from within the loop while processing each new address to relay it to a limited number of other nodes. According to git blame, the line setting `nRelayNodes` hasn't been touched since 2016 in e736772c56a *Move network-msg-processing code out of main to its own file*, which moved the line but otherwise did not change it. Running a mixed clearnet/onion node with this patch and the logging below, I'm only seeing values of `fReachable 1, nRelayNodes 2`. IIUC, I need to use the settings in `init.cpp` that call `SetReachable(*, false)`. *Edit:* with `onlynet=onion` am now seeing entries of `fReachable 0` with `nRelayNodes` values of 1 and 2. vasild: ACK 86d4cf42d Tree-SHA512: 22391e16d60bcfdec9a9336728da39d68a24a183b3d1b0e8fbc038d265ca6ddf71d16db018f3678745fd9f3e9281049e42197fa0a29124833c50a9170ed6f793 --- src/net_processing.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 53369544d8..16605ae3cf 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1400,7 +1400,6 @@ bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main) static void RelayAddress(const CAddress& addr, bool fReachable, CConnman* connman) { - unsigned int nRelayNodes = fReachable ? 2 : 1; // limited relaying of addresses outside our network(s) // Relay to a limited number of other nodes // Use deterministic randomness to send to the same nodes for 24 hours @@ -1409,6 +1408,9 @@ static void RelayAddress(const CAddress& addr, bool fReachable, CConnman* connma const CSipHasher hasher = connman->GetDeterministicRandomizer(RANDOMIZER_ID_ADDRESS_RELAY).Write(hashAddr << 32).Write((GetTime() + hashAddr) / (24*60*60)); FastRandomContext insecure_rand; + // Relay reachable addresses to 2 peers. Unreachable addresses are relayed randomly to 1 or 2 peers. + unsigned int nRelayNodes = (fReachable || (hasher.Finalize() & 1)) ? 2 : 1; + std::array,2> best{{{0, nullptr}, {0, nullptr}}}; assert(nRelayNodes <= best.size()); From 76eb5e3a030610322d9d899c034f324c4ba519fc Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 6 Sep 2020 13:03:39 +0200 Subject: [PATCH 23/26] Merge #19887: test: Fix flaky wallet_basic test 56b018ca7f37d25041b74f1bec305bdf54a55b9b test: Fix flaky wallet_basic test (Fabian Jahr) Pull request description: Fixes #19853 I investigated the issue in #19876 and I still intend to fix the underlying issue of a race when using wallet RPCs right after starting a node in that PR. However, since that is a bit more complicated than I initially thought it makes sense to merge the fix of the test so the intermittent test failures stop. This fix in the test is going to be needed, either way, #19876 will only provide an error where before it was reporting a false balance. Top commit has no ACKs. Tree-SHA512: 52bb2388a3e77aa20d26ab0fd45796bc1781483b1cffe49cbb44e2488a72e76998edfb1198495373f9c6fd2ec26064d4176bd1a64dd59806622d5e50a4f4e870 --- test/functional/wallet_basic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index f32d835481..8f9515f97f 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -486,6 +486,9 @@ class WalletTest(BitcoinTestFramework): timeout -= 0.5 assert_equal(len(self.nodes[0].getrawmempool()), chainlimit * 2) + # Prevent potential race condition when calling wallet RPCs right after restart + self.nodes[0].syncwithvalidationinterfacequeue() + node0_balance = self.nodes[0].getbalance() # With walletrejectlongchains we will not create the tx and store it in our wallet. assert_raises_rpc_error(-4, "Transaction has too long of a mempool chain", self.nodes[0].sendtoaddress, sending_addr, node0_balance - Decimal('0.01')) From 2ede3202ef60dead6be077486e46f6f736ba71a6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 6 Sep 2020 13:15:57 +0200 Subject: [PATCH 24/26] Merge #19890: refactor: remove unused header in protocol.cpp 2f79e9d00206a5230377f49be7b2f6da70f80417 refactor: remove unused header in protocol.cpp (Sebastian Falbesoner) Pull request description: There is no code using types or functions related to "internet operations" anymore in protocol.cpp (since #735, more than 8 years ago!), hence the header include can be removed. ACKs for top commit: practicalswift: ACK 2f79e9d00206a5230377f49be7b2f6da70f80417 -- patch looks correct and CI is happy epson121: Code review ACK 2f79e9d00206a5230377f49be7b2f6da70f80417 laanwj: ACK 2f79e9d00206a5230377f49be7b2f6da70f80417 promag: Code review ACK 2f79e9d00206a5230377f49be7b2f6da70f80417. Tree-SHA512: b3f75fa080125a34ce224f11eb13ec7b914cd9930e3bbed24f550031ce92a7e0830e8ff20159d737ffe487dfd28c24c273ad5e89c6932c8c6960d7fadb6c5e54 --- src/protocol.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/protocol.cpp b/src/protocol.cpp index 01d6bae987..3db5da208b 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -8,10 +8,6 @@ #include #include -#ifndef WIN32 -# include -#endif - static std::atomic g_initial_block_download_completed(false); namespace NetMsgType { From 788e3d31b40cc1e7cf25636a1364edebb3680cba Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 11 Sep 2020 13:12:43 +0800 Subject: [PATCH 25/26] Merge #19870: doc: update PyZMQ install instructions, fix zmq_sub.py file permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 062e6699c4ac48c3d46516190ec411dec3680a0d script: fix zmq_sub.py file permissions (Jon Atack) 36f8e0cce700576865e61035626e08c5e845a38a doc: update PyZMQ installation instructions, ZeroMQ link (Jon Atack) Pull request description: Seen while reviewing #19572. ACKs for top commit: theStack: ACK 062e6699c4ac48c3d46516190ec411dec3680a0d 🧷 fanquake: ACK 062e6699c4ac48c3d46516190ec411dec3680a0d Tree-SHA512: 2210d92385377d066984d0a83882c3ece9f0f41c901b7eb375af9cdb57296f50f227c68193ccf35926073c2b788d58976442791a9fce2fc0f76452804d5cee6a --- contrib/zmq/zmq_sub.py | 0 doc/zmq.md | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 contrib/zmq/zmq_sub.py diff --git a/contrib/zmq/zmq_sub.py b/contrib/zmq/zmq_sub.py old mode 100644 new mode 100755 diff --git a/doc/zmq.md b/doc/zmq.md index 9c29d8cf61..2bc8675bd4 100644 --- a/doc/zmq.md +++ b/doc/zmq.md @@ -1,6 +1,6 @@ # Block and Transaction Broadcasting with ZeroMQ -[ZeroMQ](http://zeromq.org/) is a lightweight wrapper around TCP +[ZeroMQ](https://zeromq.org/) is a lightweight wrapper around TCP connections, inter-process communication, and shared-memory, providing various message-oriented semantics such as publish/subscribe, request/reply, and push/pull. @@ -37,8 +37,9 @@ The ZeroMQ feature in Dash Core requires ZeroMQ API version 4.x or newer. Typically, it is packaged by distributions as something like *libzmq3-dev*. The C++ wrapper for ZeroMQ is *not* needed. -In order to run the example Python client scripts in contrib/ one must -also install *python3-zmq*, though this is not necessary for daemon +In order to run the example Python client scripts in the `contrib/zmq/` +directory, one must also install [PyZMQ](https://github.com/zeromq/pyzmq) +(generally with `pip install pyzmq`), though this is not necessary for daemon operation. ## Enabling From b682ce2a79a8737b0222a83c64dd5aef719c1b74 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 8 Oct 2020 15:06:57 +0200 Subject: [PATCH 26/26] Merge #20101: rpc: change no wallet loaded message to be clearer 907f142fc7e1d35f443be076367739faf11cc2cc rpc: change no wallet loaded message to be clearer (Andrew Chow) Pull request description: Changes the no wallet is loaded rpc error message to be clearer that no wallet is loaded and how the user can load or create a wallet. Also changes the error code from METHOD_NOT_FOUND to RPC_WALLET_NOT_FOUND as that makes more sense. ACKs for top commit: MarcoFalke: review ACK 907f142fc7e1d35f443be076367739faf11cc2cc kristapsk: ACK 907f142fc7e1d35f443be076367739faf11cc2cc. In addition to standard tests, just in case tested that this doesn't break anything with JoinMarket. meshcollider: utACK 907f142fc7e1d35f443be076367739faf11cc2cc Tree-SHA512: 4b413e6ab5430ec75a79de9db6583f2f3f38ccdf71aa373d8386a56e64f07f92200c8107c8c82c92c7c431d739615977c208b771a24c5960fa8676789b5497a2 --- src/wallet/rpcwallet.cpp | 2 +- test/functional/wallet_multiwallet.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index da714eebff..dffcb5cc0c 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -81,7 +81,7 @@ bool EnsureWalletIsAvailable(CWallet * const pwallet, bool avoidException) if (avoidException) return false; if (!HasWallets()) { throw JSONRPCError( - RPC_METHOD_NOT_FOUND, "Method not found (wallet method is disabled because no wallet is loaded)"); + RPC_WALLET_NOT_FOUND, "No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)"); } throw JSONRPCError(RPC_WALLET_NOT_SPECIFIED, "Wallet file not specified (must request wallet RPC through /wallet/ uri-path)."); diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py index 905d8421ca..9ab926a534 100755 --- a/test/functional/wallet_multiwallet.py +++ b/test/functional/wallet_multiwallet.py @@ -183,7 +183,7 @@ class MultiWalletTest(BitcoinTestFramework): self.restart_node(0, ['-nowallet']) assert_equal(node.listwallets(), []) - assert_raises_rpc_error(-32601, "Method not found", node.getwalletinfo) + assert_raises_rpc_error(-18, "No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)", node.getwalletinfo) self.log.info("Load first wallet") loadwallet_name = node.loadwallet(wallet_names[0]) @@ -278,7 +278,7 @@ class MultiWalletTest(BitcoinTestFramework): for wallet_name in self.nodes[0].listwallets(): self.nodes[0].unloadwallet(wallet_name) assert_equal(self.nodes[0].listwallets(), []) - assert_raises_rpc_error(-32601, "Method not found (wallet method is disabled because no wallet is loaded)", self.nodes[0].getwalletinfo) + assert_raises_rpc_error(-18, "No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)", self.nodes[0].getwalletinfo) # Successfully load a previously unloaded wallet self.nodes[0].loadwallet('w1')