From 35f6314123d3de99a734e718b42a88100c0ae839 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sun, 20 Feb 2022 11:32:09 -0500 Subject: [PATCH] Correctly link against librandomx in build --- src/Makefile.am | 10 +++++++--- src/miner.cpp | 8 +++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3232cabdb..5d73c049f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,6 +53,7 @@ LIBCRYPTOCONDITIONS=cryptoconditions/libcryptoconditions_core.la LIBUNIVALUE=univalue/libunivalue.la LIBZCASH=libzcash.a LIBHUSH=libhush.a +LIBRANDOMX=RandomX/build/librandomx.a if ENABLE_ZMQ LIBBITCOIN_ZMQ=libbitcoin_zmq.a @@ -505,7 +506,8 @@ hushd_LDADD = \ $(LIBLEVELDB) \ $(LIBMEMENV) \ $(LIBSECP256K1) \ - $(LIBCRYPTOCONDITIONS) + $(LIBCRYPTOCONDITIONS) \ + $(LIBRANDOMX) if ENABLE_WALLET hushd_LDADD += $(LIBBITCOIN_WALLET) @@ -583,7 +585,8 @@ wallet_utility_LDADD = \ $(CRYPTO_LIBS) \ $(LIBZCASH) \ $(LIBZCASH_LIBS)\ - $(LIBCRYPTOCONDITIONS) + $(LIBCRYPTOCONDITIONS) \ + $(LIBRANDOMX) endif # hush-tx binary # @@ -605,7 +608,8 @@ hush_tx_LDADD = \ $(LIBHUSH) \ $(LIBBITCOIN_CRYPTO) \ $(LIBZCASH_LIBS) \ - $(LIBCRYPTOCONDITIONS) + $(LIBCRYPTOCONDITIONS) \ + $(LIBRANDOMX) hush_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) diff --git a/src/miner.cpp b/src/miner.cpp index da19909c8..50480e821 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -116,6 +116,7 @@ public: }; extern int8_t ASSETCHAINS_ADAPTIVEPOW; +extern uint32_t ASSETCHAINS_RANDOMX; void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev) { @@ -1025,8 +1026,9 @@ void static RandomXMiner() miningTimer.start(); try { - if ( SMART_CHAIN_SYMBOL[0] != 0 ) - fprintf(stderr,"try %s Mining with %s\n",SMART_CHAIN_SYMBOL,solver.c_str()); + if ( SMART_CHAIN_SYMBOL[0] != 0 ) { + fprintf(stderr,"trying %s Mining with randomx\n",SMART_CHAIN_SYMBOL); + } while (true) { if (chainparams.MiningRequiresPeers()) { @@ -1109,7 +1111,7 @@ void static RandomXMiner() } IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); //fprintf(stderr,"Running HushMiner.%s with %u transactions in block\n",solver.c_str(),(int32_t)pblock->vtx.size()); - LogPrintf("Running HushRandomXMiner with %u transactions in block (%u bytes)\n",,pblock->vtx.size(),::GetSerializeSize(*pblock,SER_NETWORK,PROTOCOL_VERSION)); + LogPrintf("Running HushRandomXMiner with %u transactions in block (%u bytes)\n",pblock->vtx.size(),::GetSerializeSize(*pblock,SER_NETWORK,PROTOCOL_VERSION)); // Search uint8_t pubkeys[66][33]; arith_uint256 bnMaxPoSdiff; uint32_t blocktimes[66]; int mids[256],nonzpkeys,i,j,externalflag; uint32_t savebits; int64_t nStart = GetTime();