Skip to content

Commit

Permalink
Merge bitcoin#17858: [0.19] Backports
Browse files Browse the repository at this point in the history
99b5407 scripts: fix check-symbols & check-security argument passing (fanquake)
4330a1e Update msvc build for Visual Studio 2019 v16.4 (Aaron Clauson)
b0f9b8e Moves vcpkg list to a text file and updates the appveyor job and readme to use it. (Aaron Clauson)
cd7b3b2 Updated appveyor config:  - Update build image from Visual Studio 2017 to Visual Studio 2019.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added commands to update vcpkg port files (this does not update already installed packages).  - Updated vcpkg package list as per bitcoin#17309.  - Removed commands setting common project file options. Now done via common.init.vcxproj include.  - Changed msbuild verbosity from normal to quiet. Normal rights a LOT of logs and impacts appveyor job duration. Updated msvc project configs:  - Updated platform toolset from v141 to v142.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added ignore for linker warning building bitcoin-qt program.  - Added missing util/str.cpp class file to test_bitcoin project file. (Aaron Clauson)
112144d Add missing typeinfo includes (Wladimir J. van der Laan)
1a6a534 net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan)
c0dc728 test: fix bitcoind already running warnings on macOS (fanquake)
5276b0e util: Add missing headers to util/fees.cpp (Hennadii Stepanov)
4d7875c rpc: require second argument only for scantxoutset start action (Andrew Chow)
bda2f5b cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice (Harris)
d14ab7c gui: disable File->CreateWallet during startup (fanquake)
b9f1bc0 wallet: unbreak with boost 1.72 (Jan Beich)

Pull request description:

  Backports the following PRs to the 0.19 branch:
  * bitcoin#17654 - Unbreak build with Boost 1.72.0
  * bitcoin#17695 - gui: disable File->CreateWallet during startup
  * bitcoin#17687 - cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
  * bitcoin#17728 - rpc: require second argument only for scantxoutset start action
  * bitcoin#17450 - util: Add missing headers to util/fees.cpp
  * bitcoin#17488 - test: fix "bitcoind already running" warnings on macOS
  * bitcoin#17762 - Log to net category for exceptions in ProcessMessages
  * bitcoin#17364 - Updates to appveyor config for VS2019 and Qt5.9.8 + msvc project fixes
  * bitcoin#17416 - Appveyor improvement - text file for vcpkg package list
  * bitcoin#17736 - Update msvc build for Visual Studio 2019 v16.4
  * bitcoin#17857 - scripts: fix symbol-check & security-check argument passing

  Fixes bitcoin#17856.

ACKs for top commit:
  sipsorcery:
    ACK (tested: Windows 10 & msvc build) 99b5407.

Tree-SHA512: 91313de56fb0825e70a4be30ba0bf561b8c26d7dcf60549185df4f5e3524099398c828bb46faae807b631634d1afd5a1d397fb41e61ecfa0d746e4bf10b923cb
  • Loading branch information
laanwj authored and Munkybooty committed Dec 9, 2021
1 parent 6ce7e30 commit e32f0d5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/Makefile.am
Expand Up @@ -869,13 +869,13 @@ clean-local:
check-symbols: $(bin_PROGRAMS)
if GLIBC_BACK_COMPAT
@echo "Checking glibc back compat..."
$(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(PYTHON) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
$(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(PYTHON) $(top_srcdir)/contrib/devtools/symbol-check.py $(bin_PROGRAMS)
endif

check-security: $(bin_PROGRAMS)
if HARDEN
@echo "Checking binary security..."
$(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(PYTHON) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)
$(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(PYTHON) $(top_srcdir)/contrib/devtools/security-check.py $(bin_PROGRAMS)
endif


Expand Down
29 changes: 4 additions & 25 deletions src/net_processing.cpp
Expand Up @@ -37,6 +37,7 @@
#include <util/validation.h>

#include <memory>
#include <typeinfo>

#include <spork.h>
#include <governance/governance.h>
Expand Down Expand Up @@ -4074,32 +4075,10 @@ bool PeerLogicValidation::ProcessMessages(CNode* pfrom, std::atomic<bool>& inter
return false;
if (!pfrom->vRecvGetData.empty())
fMoreWork = true;
}
catch (const std::ios_base::failure& e)
{
if (m_enable_bip61) {
connman->PushMessage(pfrom, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, strCommand, REJECT_MALFORMED, std::string("error parsing message")));
}
if (strstr(e.what(), "end of data")) {
// Allow exceptions from under-length message on vRecv
LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' caught, normally caused by a message being shorter than its stated length\n", __func__, SanitizeString(strCommand), nMessageSize, e.what());
} else if (strstr(e.what(), "size too large")) {
// Allow exceptions from over-long size
LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' caught\n", __func__, SanitizeString(strCommand), nMessageSize, e.what());
} else if (strstr(e.what(), "non-canonical ReadCompactSize()")) {
// Allow exceptions from non-canonical encoding
LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' caught\n", __func__, SanitizeString(strCommand), nMessageSize, e.what());
} else if (strstr(e.what(), "Superfluous witness record")) {
// Allow exceptions from illegal witness encoding
LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' caught\n", __func__, SanitizeString(strCommand), nMessageSize, e.what());
} else if (strstr(e.what(), "Unknown transaction optional data")) {
// Allow exceptions from unknown witness encoding
LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' caught\n", __func__, SanitizeString(strCommand), nMessageSize, e.what());
} else {
PrintExceptionContinue(std::current_exception(), "ProcessMessages()");
}
} catch (const std::exception& e) {
LogPrint(BCLog::NET, "%s(%s, %u bytes): Exception '%s' (%s) caught\n", __func__, SanitizeString(strCommand), nMessageSize, e.what(), typeid(e).name());
} catch (...) {
PrintExceptionContinue(std::current_exception(), "ProcessMessages()");
LogPrint(BCLog::NET, "%s(%s, %u bytes): Unknown exception caught\n", __func__, SanitizeString(strCommand), nMessageSize);
}

if (!fRet) {
Expand Down
7 changes: 6 additions & 1 deletion src/rpc/blockchain.cpp
Expand Up @@ -2485,7 +2485,7 @@ UniValue scantxoutset(const JSONRPCRequest& request)
" \"start\" for starting a scan\n"
" \"abort\" for aborting the current scan (returns true when abort was successful)\n"
" \"status\" for progress report (in %) of the current scan"},
{"scanobjects", RPCArg::Type::ARR, RPCArg::Optional::NO, "Array of scan objects\n"
{"scanobjects", RPCArg::Type::ARR, RPCArg::Optional::OMITTED, "Array of scan objects. Required for \"start\" action\n"
" Every scan object is either a string descriptor or an object:",
{
{"descriptor", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "An output descriptor"},
Expand Down Expand Up @@ -2542,6 +2542,11 @@ UniValue scantxoutset(const JSONRPCRequest& request)
if (!reserver.reserve()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Scan already in progress, use action \"abort\" or \"status\"");
}

if (request.params.size() < 2) {
throw JSONRPCError(RPC_MISC_ERROR, "scanobjects argument is required for the start action");
}

std::set<CScript> needles;
std::map<CScript, std::string> descriptors;
CAmount total_in = 0;
Expand Down
1 change: 1 addition & 0 deletions src/util/system.cpp
Expand Up @@ -75,6 +75,7 @@
#endif

#include <thread>
#include <typeinfo>

// Application startup time (used for uptime calculation)
const int64_t nStartupTime = GetTime();
Expand Down
4 changes: 4 additions & 0 deletions test/functional/rpc_scantxoutset.py
Expand Up @@ -99,5 +99,9 @@ def run_test(self):
assert_equal(descriptors(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)"])), ["pkh([0c5f9a1e/1/1/0]03e1c5b6e650966971d7e71ef2674f80222752740fc1dfd63bbbd220d2da9bd0fb)#cxmct4w8"])
assert_equal(descriptors(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/*)", "range": 1500}])), ['pkh([0c5f9a1e/1/1/0]03e1c5b6e650966971d7e71ef2674f80222752740fc1dfd63bbbd220d2da9bd0fb)#cxmct4w8', 'pkh([0c5f9a1e/1/1/1500]03832901c250025da2aebae2bfb38d5c703a57ab66ad477f9c578bfbcd78abca6f)#vchwd07g', 'pkh([0c5f9a1e/1/1/1]030d820fc9e8211c4169be8530efbc632775d8286167afd178caaf1089b77daba7)#z2t3ypsa'])

# Check that status and abort don't need second arg
assert_equal(self.nodes[0].scantxoutset("status"), None)
assert_equal(self.nodes[0].scantxoutset("abort"), False)

if __name__ == '__main__':
ScantxoutsetTest().main()
3 changes: 2 additions & 1 deletion test/functional/test_runner.py
Expand Up @@ -370,7 +370,8 @@ def main():
def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0,failfast=False, runs_ci=False):
args = args or []

# Warn if dashd is already running (unix only)
# Warn if dashd is already running
# pidof might fail or return an empty string if bitcoind is not running
try:
pidof_output = subprocess.check_output(["pidof", "dashd"])
if not (pidof_output is None or pidof_output == b''):
Expand Down

0 comments on commit e32f0d5

Please sign in to comment.