Merge pull request 'Sync duke to dev' (#415) from duke into dev

Reviewed-on: https://git.hush.is/hush/hush3/pulls/415
This commit is contained in:
duke
2024-08-11 19:01:17 +02:00
5 changed files with 37 additions and 3 deletions

23
debug-build.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
set -eu -o pipefail
echo "Compiling a debug build with --enable-debug..."
# run correct build script for detected OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
CONFIGURE_FLAGS=--enable-debug ./util/build.sh --disable-tests $@
elif [[ "$OSTYPE" == "darwin"* ]]; then
# code from ./util/build.sh needs to be ported to support --disable-tests
#./util/build-mac.sh --disable-tests $@
CONFIGURE_FLAGS=--enable-debug ./util/build-mac.sh $@
elif [[ "$OSTYPE" == "msys"* ]]; then
CONFIGURE_FLAGS=--enable-debug ./util/build-win.sh --disable-tests $@
elif [[ "$OSTYPE" == "freebsd"* ]]; then
CONFIGURE_FLAGS=--enable-debug ./util/build.sh --disable-tests $@
else
echo "Unable to detect your OS. What are you using?"
fi

View File

@@ -13,7 +13,7 @@ define $(package)_preprocess_cmds
endef
define $(package)_set_vars
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples
$(package)_config_opts_release=--disable-debug-mode
$(package)_config_opts_linux=--with-pic
endef

View File

@@ -1085,6 +1085,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
LogPrintf("Hush version %s (%s)\n", FormatFullVersion());
#ifdef DEBUG_LOCKORDER
LogPrintf("DEBUG_LOCKORDER enabled\n");
#else
LogPrintf("DEBUG_LOCKORDER disabled\n");
#endif
// when specifying an explicit binding address, you want to listen on it
// even when -connect or -proxy is specified
if (mapArgs.count("-bind")) {

View File

@@ -6915,8 +6915,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
int nVersion; // use temporary for version, don't set version number until validated as connected
const int minVersion = ishush3 ? MIN_HUSH_PEER_PROTO_VERSION : MIN_PEER_PROTO_VERSION;
vRecv >> nVersion >> pfrom->nServices >> nTime >> addrMe;
if (nVersion == 10300)
nVersion = 300;
if (nVersion < minVersion)
{
// disconnect from peers older than this proto version

View File

@@ -47,6 +47,8 @@ static const bool DEFAULT_LOGTIMEMICROS = false;
static const bool DEFAULT_LOGIPS = false;
static const bool DEFAULT_LOGTIMESTAMPS = true;
void CheckIfWeShouldStop();
/** Signals for translation. */
class CTranslationInterface
{
@@ -272,14 +274,17 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
catch (const boost::thread_interrupted&)
{
LogPrintf("%s thread interrupt\n", name);
CheckIfWeShouldStop();
throw;
}
catch (const std::exception& e) {
PrintExceptionContinue(&e, name);
CheckIfWeShouldStop();
throw;
}
catch (...) {
PrintExceptionContinue(NULL, name);
CheckIfWeShouldStop();
throw;
}
}