From a8411b3d9c37b4c6fcf0ab992d3f622f6bda879b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 16 Jul 2020 20:22:11 +0300 Subject: qt: Fix QFileDialog for static builds This change partially reverts 248e22bbc0d7bc40ae3584d53a18507c46b0e553. Github-Pull: #19536 Rebased-From: 6457361e90c0cf704d086c51d75f51dbdfd374d7 --- depends/packages/qt.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index f4832b6168..cdafbfc936 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -76,7 +76,6 @@ $(package)_config_opts += -no-feature-colordialog $(package)_config_opts += -no-feature-commandlineparser $(package)_config_opts += -no-feature-concurrent $(package)_config_opts += -no-feature-dial -$(package)_config_opts += -no-feature-filesystemwatcher $(package)_config_opts += -no-feature-fontcombobox $(package)_config_opts += -no-feature-ftp $(package)_config_opts += -no-feature-image_heuristic_mask -- cgit v1.2.3 From 8bd2ab1f35f1b3f618fa801debf844eb164a2bd6 Mon Sep 17 00:00:00 2001 From: Nadav Ivgi Date: Fri, 21 Aug 2020 17:41:02 +0300 Subject: docs: Correct description for getblockstats's txs field It does count the coinbase transaction. Refs #19766 Github-Pull: #19777 Rebased-From: 4148f55dd016f940df50a44cf03d117cdb1dd929 --- src/rpc/blockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index ad5be71e21..7c08c0a45f 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1717,7 +1717,7 @@ static UniValue getblockstats(const JSONRPCRequest& request) " \"90th_percentile_feerate\", (numeric) The 90th percentile feerate\n" " ],\n" " \"height\": xxxxx, (numeric) The height of the block\n" - " \"ins\": xxxxx, (numeric) The number of inputs (excluding coinbase)\n" + " \"ins\": xxxxx, (numeric) The number of inputs (including coinbase)\n" " \"maxfee\": xxxxx, (numeric) Maximum fee in the block\n" " \"maxfeerate\": xxxxx, (numeric) Maximum feerate (in satoshis per virtual byte)\n" " \"maxtxsize\": xxxxx, (numeric) Maximum transaction size\n" -- cgit v1.2.3 From 27bb2cc3b6053f94b38934748127bc73f87618ad Mon Sep 17 00:00:00 2001 From: MIZUTA Takeshi Date: Mon, 8 Jun 2020 16:37:59 +0900 Subject: util: Don't reference errno when pthread fails. Pthread library does not set errno. Pthread library's errno is returned by return value. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Github-Pull: #19194 Rebased-From: cb38b069b0f41b1a26264784b1c1303c8ac6ab08 --- src/util/system.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/system.cpp b/src/util/system.cpp index 5a3c68aa0c..db1d032916 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1236,9 +1236,10 @@ int ScheduleBatchPriority() { #ifdef SCHED_BATCH const static sched_param param{}; - if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m)) { - LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno)); - return ret; + const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m); + if (rc != 0) { + LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(rc)); + return rc; } return 0; #else -- cgit v1.2.3 From 6957419a28ec3a129177fbdabcae48889a8bbab0 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 13 Oct 2020 12:22:02 +0800 Subject: build: set minimum required Boost to 1.48.0 Due to the use of boost::filesystem::canonical(), the minimum required version of Boost is actually 1.48.0. Use of canonical was introduced in #14146. See also Boost filesystem 1.48.0 release notes: https://github.com/boostorg/filesystem/blob/6b5e38134a336b6ea777cd8a69b6ae929819db7e/doc/release_history.html#L508 Github-Pull: #20142 Rebased-From: 3562c15be3dbf725197d719d58c8d78e2f2c6779 --- configure.ac | 2 +- doc/dependencies.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ad6de55561..dd49c2f672 100644 --- a/configure.ac +++ b/configure.ac @@ -1055,7 +1055,7 @@ fi if test x$use_boost = xyes; then dnl Minimum required Boost version -define(MINIMUM_REQUIRED_BOOST, 1.47.0) +define(MINIMUM_REQUIRED_BOOST, 1.48.0) dnl Check for boost libs AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST]) diff --git a/doc/dependencies.md b/doc/dependencies.md index ae3d26839f..f814f07c14 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -6,7 +6,7 @@ These are the dependencies currently used by Bitcoin Core. You can find instruct | Dependency | Version used | Minimum required | CVEs | Shared | [Bundled Qt library](https://doc.qt.io/qt-5/configure-options.html#third-party-libraries) | | --- | --- | --- | --- | --- | --- | | Berkeley DB | [4.8.30](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.x | No | | | -| Boost | [1.70.0](https://www.boost.org/users/download/) | [1.47.0](https://github.com/bitcoin/bitcoin/pull/8920) | No | | | +| Boost | [1.70.0](https://www.boost.org/users/download/) | [1.48.0](https://github.com/bitcoin/bitcoin/pull/20142) | No | | | | Clang | | [3.3+](https://releases.llvm.org/download.html) (C++11 support) | | | | | Expat | [2.2.7](https://libexpat.github.io/) | | No | Yes | | | fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) | | No | Yes | | -- cgit v1.2.3 From 5b2de04e7f37043d850bd89554789d5b86f6b735 Mon Sep 17 00:00:00 2001 From: Aaron Clauson Date: Tue, 6 Oct 2020 18:39:17 +0100 Subject: Bump vcpkg commit ID to get new msys mirror list This fixes the appveyor CI job, see #20066. Currently the job fails because some of the vcpkg dependencies need to install msys2 and the hardcoded mirror in the vcpkg config is down. Vcpkg commit 76a7e9248fb3c57350b559966dcaa2d52a5e4458 adds new mirrors to the hardcoded list. Github-Pull: #20095 Rebased-From: c83155b406b849a1589d22c34843cc883897431d --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 443913672e..0ecaa7709e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,7 +11,7 @@ environment: QT_DOWNLOAD_HASH: '9a8c6eb20967873785057fdcd329a657c7f922b0af08c5fde105cc597dd37e21' QT_LOCAL_PATH: 'C:\Qt5.9.8_x64_static_vs2019' VCPKG_INSTALL_PATH: 'C:\tools\vcpkg\installed' - VCPKG_COMMIT_ID: 'ed0df8ecc4ed7e755ea03e18aaf285fd9b4b4a74' + VCPKG_COMMIT_ID: '40230b8e3f6368dcb398d649331be878ca1e9007' install: # Disable zmq test for now since python zmq library on Windows would cause Access violation sometimes. # - cmd: pip install zmq -- cgit v1.2.3 From 0b64310fb6f1816a4ceba99eadb532c30ba867d5 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 12 Oct 2020 17:36:51 -0700 Subject: Avoid the use of abs64 in timedata Github-Pull: #20141 Rebased-From: d1292f25f272401da0c58580521c74b1fa03a9ad --- src/timedata.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/timedata.cpp b/src/timedata.cpp index 9458b9ae0c..0c6698d87a 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -37,11 +37,6 @@ int64_t GetAdjustedTime() return GetTime() + GetTimeOffset(); } -static int64_t abs64(int64_t n) -{ - return (n >= 0 ? n : -n); -} - #define BITCOIN_TIMEDATA_MAX_SAMPLES 200 void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample) @@ -81,8 +76,8 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample) int64_t nMedian = vTimeOffsets.median(); std::vector vSorted = vTimeOffsets.sorted(); // Only let other nodes change our time by so much - if (abs64(nMedian) <= std::max(0, gArgs.GetArg("-maxtimeadjustment", DEFAULT_MAX_TIME_ADJUSTMENT))) - { + int64_t max_adjustment = std::max(0, gArgs.GetArg("-maxtimeadjustment", DEFAULT_MAX_TIME_ADJUSTMENT)); + if (nMedian >= -max_adjustment && nMedian <= max_adjustment) { nTimeOffset = nMedian; } else @@ -94,9 +89,10 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample) { // If nobody has a time different than ours but within 5 minutes of ours, give a warning bool fMatch = false; - for (const int64_t nOffset : vSorted) - if (nOffset != 0 && abs64(nOffset) < 5 * 60) + for (const int64_t nOffset : vSorted) { + if (nOffset != 0 && nOffset > -5 * 60 && nOffset < 5 * 60) fMatch = true; + } if (!fMatch) { -- cgit v1.2.3 From a7bdf5c3ac360a918d398a775c2de21d1e2ed639 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 30 Aug 2020 10:28:42 +0200 Subject: rpc: Properly deserialize txs with witness before signing Github-Pull: #19836 Rebased-From: cccc7525697e7b8d99b545e34f0f504c78ffdb94 --- src/rpc/rawtransaction.cpp | 4 ++-- src/wallet/rpcwallet.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 3b202d6538..2155d4fb75 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -619,7 +619,7 @@ static UniValue combinerawtransaction(const JSONRPCRequest& request) std::vector txVariants(txs.size()); for (unsigned int idx = 0; idx < txs.size(); idx++) { - if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true)) { + if (!DecodeHexTx(txVariants[idx], txs[idx].get_str())) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf("TX decode failed for tx %d", idx)); } } @@ -738,7 +738,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request) RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR}, true); CMutableTransaction mtx; - if (!DecodeHexTx(mtx, request.params[0].get_str(), true)) { + if (!DecodeHexTx(mtx, request.params[0].get_str())) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index fe004a862d..88725a6b09 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3269,7 +3269,7 @@ UniValue signrawtransactionwithwallet(const JSONRPCRequest& request) RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VSTR}, true); CMutableTransaction mtx; - if (!DecodeHexTx(mtx, request.params[0].get_str(), true)) { + if (!DecodeHexTx(mtx, request.params[0].get_str())) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } -- cgit v1.2.3 From 9c714993e9dba2f08c2c89cf06ad8fecd528ad1b Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 13 Oct 2020 15:21:03 +0200 Subject: rpc: Adjust witness-tx deserialize error message Github-Pull: #19836 Rebased-From: 33330778230961cfbf2a24de36b5877e395cc596 --- src/rpc/rawtransaction.cpp | 12 ++++++------ src/wallet/rpcdump.cpp | 5 +++-- src/wallet/rpcwallet.cpp | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 2155d4fb75..b155a3289d 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -620,7 +620,7 @@ static UniValue combinerawtransaction(const JSONRPCRequest& request) for (unsigned int idx = 0; idx < txs.size(); idx++) { if (!DecodeHexTx(txVariants[idx], txs[idx].get_str())) { - throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf("TX decode failed for tx %d", idx)); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf("TX decode failed for tx %d. Make sure the tx has at least one input.", idx)); } } @@ -739,7 +739,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request) CMutableTransaction mtx; if (!DecodeHexTx(mtx, request.params[0].get_str())) { - throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed. Make sure the tx has at least one input."); } FillableSigningProvider keystore; @@ -800,10 +800,10 @@ static UniValue sendrawtransaction(const JSONRPCRequest& request) UniValueType(), // NUM or BOOL, checked later }); - // parse hex string from parameter CMutableTransaction mtx; - if (!DecodeHexTx(mtx, request.params[0].get_str())) - throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); + if (!DecodeHexTx(mtx, request.params[0].get_str())) { + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed. Make sure the tx has at least one input."); + } CTransactionRef tx(MakeTransactionRef(std::move(mtx))); CFeeRate max_raw_tx_fee_rate = DEFAULT_MAX_RAW_TX_FEE_RATE; @@ -875,7 +875,7 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request) CMutableTransaction mtx; if (!DecodeHexTx(mtx, request.params[0].get_array()[0].get_str())) { - throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed. Make sure the tx has at least one input."); } CTransactionRef tx(MakeTransactionRef(std::move(mtx))); const uint256& tx_hash = tx->GetHash(); diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index f52e4318c8..5cfc6cfea2 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -353,8 +353,9 @@ UniValue importprunedfunds(const JSONRPCRequest& request) }.Check(request); CMutableTransaction tx; - if (!DecodeHexTx(tx, request.params[0].get_str())) - throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); + if (!DecodeHexTx(tx, request.params[0].get_str())) { + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed. Make sure the tx has at least one input."); + } uint256 hashTx = tx.GetHash(); CWalletTx wtx(pwallet, MakeTransactionRef(std::move(tx))); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 88725a6b09..4113c14ce4 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3270,7 +3270,7 @@ UniValue signrawtransactionwithwallet(const JSONRPCRequest& request) CMutableTransaction mtx; if (!DecodeHexTx(mtx, request.params[0].get_str())) { - throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed. Make sure the tx has at least one input."); } // Sign the transaction -- cgit v1.2.3