From e3136765623a7c3b817fb9755d7bbefd9cdffee6 Mon Sep 17 00:00:00 2001 From: fekt Date: Thu, 27 Oct 2022 16:49:02 -0400 Subject: [PATCH] Mac build fixes --- configure.ac | 2 +- depends/hosts/darwin.mk | 2 +- depends/packages/libgmp.mk | 11 +++++------ src/init.cpp | 13 ++++++++++--- src/rpc/rawtransaction.cpp | 4 +++- src/stratum.cpp | 11 +++++++---- src/util.cpp | 7 ++----- 7 files changed, 29 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index c542219cd..94f48dd31 100644 --- a/configure.ac +++ b/configure.ac @@ -709,7 +709,7 @@ fi # These packages don't provide pkgconfig config files across all # platforms, so we use older autoconf detection mechanisms: AC_CHECK_HEADER([gmp.h],,AC_MSG_ERROR(libgmp headers missing)) -AC_CHECK_LIB([gmp],[[__gmpn_sub_n]],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing)]) +#AC_CHECK_LIB([gmp],[[__gmpn_sub_n]],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing)]) AC_CHECK_HEADER([gmpxx.h],,AC_MSG_ERROR(libgmpxx headers missing)) AC_CHECK_LIB([gmpxx],[main],GMPXX_LIBS=-lgmpxx, [AC_MSG_ERROR(libgmpxx missing)]) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 309f4507c..7be744aeb 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -8,7 +8,7 @@ darwin_CXX=g++-8 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysro darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) -darwin_release_CFLAGS=-O3 +darwin_release_CFLAGS=-O1 darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) darwin_debug_CFLAGS=-O1 diff --git a/depends/packages/libgmp.mk b/depends/packages/libgmp.mk index fece8f822..92cd95fbc 100644 --- a/depends/packages/libgmp.mk +++ b/depends/packages/libgmp.mk @@ -9,12 +9,11 @@ $(package)_git_commit=42ba95387cdfd67399f7aac52fddb8d6e1258ee6 $(package)_dependencies= $(package)_config_opts=--enable-cxx --disable-shared else ifeq ($(build_os),darwin) -$(package)_download_path=https://git.hush.is/duke/$(package)/archive -$(package)_file_name=$(package)-$($(package)_git_commit).tar.gz -$(package)_download_file=$($(package)_git_commit).tar.gz -$(package)_sha256_hash=59b2c2b5d58fdf5943bfde1fa709e9eb53e7e072c9699d28dc1c2cbb3c8cc32c -$(package)_git_commit=aece03c7b6967f91f3efdac8c673f55adff53ab1 -$(package)_dependencies= +$(package)_version=6.1.1 +$(package)_download_path=https://git.hush.is/attachments +$(package)_file_name=d613c855-cd92-4efb-b893-658496852019 +$(package)_download_file=d613c855-cd92-4efb-b893-658496852019 +$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6 $(package)_config_opts=--enable-cxx --disable-shared else $(package)_version=6.1.1 diff --git a/src/init.cpp b/src/init.cpp index 9cdd3a034..1dda35e1c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1137,9 +1137,16 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if(fs::exists(asmap_path)) { printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() ); } else { - // Shit is fucked up, die an honorable death - InitError(strprintf(_("Could not find any asmap file! Please report this bug to Hush Developers"))); - return false; + // Mac SD + asmap_path = fs::path("/Applications/SilentDragon.app/Contents/MacOS/") / DEFAULT_ASMAP_FILENAME; + printf("%s: looking for asmap file at %s\n", __func__, asmap_path.c_str() ); + if(fs::exists(asmap_path)) { + printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() ); + } else { + // Shit is fucked up, die an honorable death + InitError(strprintf(_("Could not find any asmap file! Please report this bug to Hush Developers"))); + return false; + } } } } diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 635d71d7c..d53ddd09f 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -453,8 +453,10 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp, const CPubKey& my return strHex; UniValue result(UniValue::VOBJ); + unsigned int serializeSize = GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); + result.push_back(Pair("hex", strHex)); - result.push_back(Pair("size", GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) )); + result.push_back(Pair("size", serializeSize)); TxToJSONExpanded(tx, hashBlock, result, nHeight, nConfirmations, nBlockTime); return result; } diff --git a/src/stratum.cpp b/src/stratum.cpp index 287cd609d..84aba23cd 100644 --- a/src/stratum.cpp +++ b/src/stratum.cpp @@ -1997,10 +1997,13 @@ UniValue rpc_stratum_updatework(const UniValue& params, bool fHelp, const CPubKe // throw JSONRPCError(RPC_INTERNAL_ERROR, "Something went wrong, plz try again!"); // } + uint64_t clientsSize = json_clients.size(); + uint64_t subscriptionsSize = subscriptions.size(); + obj.push_back(Pair("clients", json_clients)); - obj.push_back(Pair("updated", json_clients.size())); + obj.push_back(Pair("updated", clientsSize)); obj.push_back(Pair("skipped", skipped)); - obj.push_back(Pair("total", subscriptions.size())); + obj.push_back(Pair("total", subscriptionsSize)); return obj; } @@ -2126,9 +2129,9 @@ UniValue rpc_stratum_getclientscount (const UniValue& params, bool fHelp, const + HelpExampleCli("stratum_getclientscount", "") + HelpExampleRpc("stratum_getclientscount", "") ); - UniValue obj(UniValue::VOBJ); - obj.push_back(Pair("total", subscriptions.size())); + uint64_t subscriptionsSize = subscriptions.size(); + obj.push_back(Pair("total", subscriptionsSize)); return obj; }; diff --git a/src/util.cpp b/src/util.cpp index 47ca963b4..e0e558672 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -558,12 +558,12 @@ boost::filesystem::path GetDefaultDataDir() tmppath = pathRet; tmppath /= "Komodo"; //TryCreateDirectory(tmppath); - if(fs::is_directory( tmppath / symbol) { + if(fs::is_directory( tmppath / symbol)) { // Found legacy dir, use that return tmppath / symbol; } else { // For new clones, use Hush/HUSH3 - tmppath = pathRet / "Hush" / HUSH3; + tmppath = pathRet / "Hush" / "HUSH3"; } return tmppath; } @@ -1036,11 +1036,8 @@ std::string LicenseInfo() { return "\n" + FormatParagraph(strprintf(_("Copyright (C) 2016-%i Duke Leto and The Hush Developers"), COPYRIGHT_YEAR)) + "\n" + - "\n" + FormatParagraph(strprintf(_("Copyright (C) 2016-2020 jl777 and SuperNET developers"))) + "\n" + - "\n" + FormatParagraph(strprintf(_("Copyright (C) 2016-2018 The Zcash developers"))) + "\n" + - "\n" + FormatParagraph(strprintf(_("Copyright (C) 2009-2014 The Bitcoin Core developers"))) + "\n" + "\n" + FormatParagraph(_("This is experimental Free Software! Fuck Yeah!!!!!")) + "\n" +