diff --git a/README.md b/README.md index 4a7cfd389..b1a7cbbbf 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,6 @@ cd hush3 The links for the Official Hush explorers: * [explorer.hush.is](https://explorer.hush.is) - * [explorer.hush.land](https://explorer.hush.land) # What is SilentDragon? diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk index 3805d2307..4895b1e30 100644 --- a/depends/hosts/linux.mk +++ b/depends/hosts/linux.mk @@ -10,15 +10,15 @@ linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC ifeq (86,$(findstring 86,$(build_arch))) -i686_linux_CC=gcc -m32 -i686_linux_CXX=g++ -m32 +i686_linux_CC=$(CC) -m32 +i686_linux_CXX=$(CXX) -m32 i686_linux_AR=ar i686_linux_RANLIB=ranlib i686_linux_NM=nm i686_linux_STRIP=strip -x86_64_linux_CC=gcc -m64 -x86_64_linux_CXX=g++ -m64 +x86_64_linux_CC=$(CC) -m64 +x86_64_linux_CXX=$(CXX) -m64 x86_64_linux_AR=ar x86_64_linux_RANLIB=ranlib x86_64_linux_NM=nm diff --git a/doc/relnotes/README.md b/doc/relnotes/README.md index cb9172162..c85c387c0 100644 --- a/doc/relnotes/README.md +++ b/doc/relnotes/README.md @@ -12,6 +12,8 @@ evil organizations. They also use all your "private" repos to train their AI. # Hush 3.10.5 "" +This is an OPTIONAL but RECOMMENDED upgrade. + * Concurrent `z_sendmany` now works * A longstanding bug relating to run multiple `z_sendmany` operations at once has been fixed. You can now queue up many `z_sendmany` operations @@ -25,6 +27,7 @@ evil organizations. They also use all your "private" repos to train their AI. release, which caused some nodes to be unable to sync. * This release fixes this issue. * Updated test framework and tests which allowed the fixing of the `z_sendmany` bug above + * Faster compiling of RandomX internals # Hush 3.10.4 "Hazy Hākuturi" diff --git a/src/cc/Makefile_custom b/src/cc/Makefile_custom index 9db01b106..d3ecf9c25 100644 --- a/src/cc/Makefile_custom +++ b/src/cc/Makefile_custom @@ -1,5 +1,4 @@ SHELL = /bin/sh -CC = gcc CC_DARWIN = g++-8 CC_WIN = x86_64-w64-mingw32-gcc-posix CC_AARCH64 = aarch64-linux-gnu-g++ diff --git a/src/net.cpp b/src/net.cpp index 4b52c796d..efac15c12 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -45,6 +45,7 @@ #include using namespace hush; extern int32_t HUSH_TESTNODE; +extern uint8_t ASSETCHAINS_CLEARNET; // Dump addresses to peers.dat every 5 minutes (300s) // Satoshi originally used 10 seconds(!), did they know something Peter Wuille didn't? @@ -1653,7 +1654,7 @@ int64_t PoissonNextSend(int64_t now, int average_interval_seconds) void ASMapHealthCheck() { // No health check if clearnet is disabled - if (!GetBoolArg("-clearnet", DEFAULT_CLEARNET)) { + if (ASSETCHAINS_CLEARNET == 0 || !GetBoolArg("-clearnet", DEFAULT_CLEARNET)) { return; } diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index a16dde687..6d5a166b4 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -428,7 +428,6 @@ static const CRPCCommand vRPCCommands[] = { "wallet", "getaddressesbyaccount", &getaddressesbyaccount, true }, { "wallet", "cleanwallettransactions", &cleanwallettransactions, false }, { "wallet", "getbalance", &getbalance, false }, - { "wallet", "getbalance64", &getbalance64, false }, { "wallet", "getnewaddress", &getnewaddress, true }, { "wallet", "getrawchangeaddress", &getrawchangeaddress, true }, { "wallet", "getreceivedbyaccount", &getreceivedbyaccount, false }, diff --git a/src/rpc/server.h b/src/rpc/server.h index eff98f9c2..08c60fe16 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -258,7 +258,6 @@ extern UniValue getreceivedbyaddress(const UniValue& params, bool fHelp, const C extern UniValue getreceivedbyaccount(const UniValue& params, bool fHelp, const CPubKey& mypk); extern UniValue cleanwallettransactions(const UniValue& params, bool fHelp, const CPubKey& mypk); extern UniValue getbalance(const UniValue& params, bool fHelp, const CPubKey& mypk); -extern UniValue getbalance64(const UniValue& params, bool fHelp, const CPubKey& mypk); extern UniValue getunconfirmedbalance(const UniValue& params, bool fHelp, const CPubKey& mypk); extern UniValue movecmd(const UniValue& params, bool fHelp, const CPubKey& mypk); extern UniValue sendfrom(const UniValue& params, bool fHelp, const CPubKey& mypk); diff --git a/src/wallet/asyncrpcoperation_shieldcoinbase.cpp b/src/wallet/asyncrpcoperation_shieldcoinbase.cpp index 34d87b58f..4c200d19a 100644 --- a/src/wallet/asyncrpcoperation_shieldcoinbase.cpp +++ b/src/wallet/asyncrpcoperation_shieldcoinbase.cpp @@ -69,7 +69,7 @@ AsyncRPCOperation_shieldcoinbase::AsyncRPCOperation_shieldcoinbase( } if (donation < 0 || donation > 10 ) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid donation percentage, must be an integer between 0 and 10"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid donation percentage, must be an integer between 0 and 10 inclusive"); } // Check the destination address is valid for this network i.e. not testnet being used on mainnet @@ -216,17 +216,17 @@ bool ShieldToAddress::operator()(const libzcash::SaplingPaymentAddress &zaddr) c m_op->builder_.AddTransparentInput(COutPoint(t.txid, t.vout), t.scriptPubKey, t.amount); } } - //TODO: TESTING zaddr only, only use on regtest - //TODO: randomly select from a set - auto dzaddr = "zregtestsapling1y30nwg0clsu6gcyrnvht8hdyfk3vwtszlh6kc4z5hv9hmpxzg2g0nx7c60xeecggm9x9gma96t4"; - auto donationZaddr = DecodePaymentAddress(dzaddr); - if (!IsValidPaymentAddress(donationZaddr)) { - throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid donation zaddr, Unknown address format: ") + dzaddr); - } - if(donation) { //if donation>0, send X% of value to zaddr and Y% of of value to donatezaddr where X+Y=100% + //TODO: TESTING zaddr only, only use on regtest + //TODO: randomly select from a set + auto dzaddr = "zregtestsapling1y30nwg0clsu6gcyrnvht8hdyfk3vwtszlh6kc4z5hv9hmpxzg2g0nx7c60xeecggm9x9gma96t4"; + auto donationZaddr = DecodePaymentAddress(dzaddr); + if (!IsValidPaymentAddress(donationZaddr)) { + throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid donation zaddr, Unknown address format: ") + dzaddr); + } + // calculate donation as a double then convert to CAmount double amount = (static_cast(donation)/100)*static_cast(sendAmount); CAmount donationAmount = static_cast(amount); diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index eb32c244f..d9f265927 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -704,7 +704,7 @@ UniValue dumpwallet_impl(const UniValue& params, bool fHelp, bool fDumpZKeys) throw JSONRPCError(RPC_INTERNAL_ERROR, e.what()); } if (exportdir.empty()) { - throw JSONRPCError(RPC_WALLET_ERROR, "Cannot export wallet until the hushd -exportdir option has been set"); + throw JSONRPCError(RPC_WALLET_ERROR, "Cannot export wallet until the -exportdir option has been set"); } std::string unclean = params[0].get_str(); std::string clean = SanitizeFilename(unclean); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 24288df6a..da348b76f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -6265,49 +6265,6 @@ UniValue setpubkey(const UniValue& params, bool fHelp, const CPubKey& mypk) return result; } -UniValue getbalance64(const UniValue& params, bool fHelp, const CPubKey& mypk) -{ - set setAddress; vector vecOutputs; - UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR),b(UniValue::VARR); CTxDestination address; - if (!EnsureWalletIsAvailable(fHelp)) - return NullUniValue; - - const CKeyStore& keystore = *pwalletMain; - CAmount nValues[64],nValues2[64],nValue,total,total2; int32_t i,segid; - if (!EnsureWalletIsAvailable(fHelp)) - return NullUniValue; - if (params.size() > 0) - throw runtime_error("getbalance64\n"); - total = total2 = 0; - memset(nValues,0,sizeof(nValues)); - memset(nValues2,0,sizeof(nValues2)); - LOCK2(cs_main, pwalletMain->cs_wallet); - pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); - BOOST_FOREACH(const COutput& out, vecOutputs) - { - nValue = out.tx->vout[out.i].nValue; - if ( ExtractDestination(out.tx->vout[out.i].scriptPubKey, address) ) - { - segid = (hush_segid32((char *)CBitcoinAddress(address).ToString().c_str()) & 0x3f); - if ( out.nDepth < 100 ) - nValues2[segid] += nValue, total2 += nValue; - else nValues[segid] += nValue, total += nValue; - //fprintf(stderr,"%s %.8f depth.%d segid.%d\n",(char *)CBitcoinAddress(address).ToString().c_str(),(double)nValue/COIN,(int32_t)out.nDepth,segid); - } else fprintf(stderr,"no destination\n"); - } - ret.push_back(Pair("mature",(double)total/COIN)); - ret.push_back(Pair("immature",(double)total2/COIN)); - for (i=0; i<64; i++) - { - a.push_back((uint64_t)nValues[i]); - b.push_back((uint64_t)nValues2[i]); - } - ret.push_back(Pair("staking", a)); - ret.push_back(Pair("notstaking", b)); - return ret; -} - - extern UniValue dumpprivkey(const UniValue& params, bool fHelp, const CPubKey& mypk); // in rpcdump.cpp extern UniValue convertpassphrase(const UniValue& params, bool fHelp, const CPubKey& mypk); extern UniValue importprivkey(const UniValue& params, bool fHelp, const CPubKey& mypk); diff --git a/util/build.sh b/util/build.sh index 6bf7a6d69..51c2c5687 100755 --- a/util/build.sh +++ b/util/build.sh @@ -125,10 +125,11 @@ eval "$MAKE" --version | head -n2 as --version | head -n1 as --version | tail -n1 ld -v +autoconf --version HOST="$HOST" BUILD="$BUILD" "$MAKE" "$@" -C ./depends/ V=1 -./autogen.sh +time ./autogen.sh CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" $CONFIGURE_FLAGS CXXFLAGS='-g' @@ -136,7 +137,7 @@ CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" WD=$PWD cd src/cc echo $PWD -./makecustom +CC=${CC:-gcc} ./makecustom cd $WD # Build RandomX @@ -147,9 +148,10 @@ then else mkdir build && cd build cmake -DARCH=native .. - make + # pass along potential -jX and other args + time make "$@" fi cd $WD -"$MAKE" "$@" V=1 +time "$MAKE" "$@" V=1