Fix CheckProofOfWork always returning true, fix hashrate display for RandomX, fix Docker root ownership

This commit is contained in:
dan_s
2026-02-22 18:10:53 -06:00
parent 64e7498942
commit aca38e6636
6 changed files with 12 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ if [[ "${1:-}" == "--linux-release" ]]; then
shift
echo "Building Linux release inside Ubuntu 20.04 Docker container..."
sudo docker build -t hush-builder -f Dockerfile.build .
sudo docker run --rm -v "$SCRIPT_DIR:/hush3" hush-builder "$@"
sudo docker run --rm --user "$(id -u):$(id -g)" -v "$SCRIPT_DIR:/hush3" hush-builder "$@"
echo "Docker build complete. Release is in release-linux/"
exit $?
fi

View File

@@ -4,7 +4,7 @@ define(_CLIENT_VERSION_MAJOR, 3)
dnl Must be kept in sync with src/clientversion.h , ugh!
define(_CLIENT_VERSION_MINOR, 10)
define(_CLIENT_VERSION_REVISION, 5)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 50)
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
define(_CLIENT_VERSION_IS_RELEASE, true)

View File

@@ -31,7 +31,7 @@
#define CLIENT_VERSION_MAJOR 3
#define CLIENT_VERSION_MINOR 10
#define CLIENT_VERSION_REVISION 5
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 50
//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true

View File

@@ -111,7 +111,7 @@ static boost::synchronized_value<std::list<std::string>> messageBox;
static boost::synchronized_value<std::string> initMessage;
static bool loaded = false;
extern int64_t GetNetworkHashPS(int lookup, int height);
extern double GetNetworkHashPS(int lookup, int height);
void TrackMinedBlock(uint256 hash)
{
@@ -233,7 +233,7 @@ int printStats(bool mining)
int height;
int64_t tipmediantime;
size_t connections;
int64_t netsolps;
double netsolps;
{
LOCK2(cs_main, cs_vNodes);
height = chainActive.Height();
@@ -242,6 +242,8 @@ int printStats(bool mining)
netsolps = GetNetworkHashPS(120, -1);
}
auto localsolps = GetLocalSolPS();
bool isRandomX = (ASSETCHAINS_ALGO == ASSETCHAINS_RANDOMX);
const char* hashUnitLabel = isRandomX ? "H/s" : "Sol/s";
if (IsInitialBlockDownload()) {
int netheight = EstimateNetHeight(height, tipmediantime, Params());
@@ -251,9 +253,9 @@ int printStats(bool mining)
std::cout << " " << _("Block height") << " | " << height << std::endl;
}
std::cout << " " << _("Connections") << " | " << connections << std::endl;
std::cout << " " << _("Network solution rate") << " | " << netsolps << " Sol/s" << std::endl;
std::cout << " " << _("Network solution rate") << " | " << strprintf("%.2f %s", netsolps, hashUnitLabel) << std::endl;
if (mining && miningTimer.running()) {
std::cout << " " << _("Local solution rate") << " | " << strprintf("%.4f Sol/s", localsolps) << std::endl;
std::cout << " " << _("Local solution rate") << " | " << strprintf("%.4f %s", localsolps, hashUnitLabel) << std::endl;
lines++;
}
std::cout << std::endl;

View File

@@ -879,7 +879,6 @@ bool CheckProofOfWork(const CBlockHeader &blkHeader, uint8_t *pubkey33, int32_t
if ( HUSH_LOADINGBLOCKS != 0 )
return true;
/*
if ( SMART_CHAIN_SYMBOL[0] != 0 || height > 792000 )
{
if ( Params().NetworkIDString() != "regtest" )
@@ -899,7 +898,6 @@ bool CheckProofOfWork(const CBlockHeader &blkHeader, uint8_t *pubkey33, int32_t
}
return false;
}
*/
}
/*for (i=31; i>=0; i--)
fprintf(stderr,"%02x",((uint8_t *)&hash)[i]);

View File

@@ -60,8 +60,9 @@ arith_uint256 hush_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t heig
* Return average network hashes per second based on the last 'lookup' blocks,
* or over the difficulty averaging window if 'lookup' is nonpositive.
* If 'height' is nonnegative, compute the estimate at the time when a given block was found.
* Returns double for accuracy with RandomX chains where hashrate can be fractional.
*/
int64_t GetNetworkHashPS(int lookup, int height)
double GetNetworkHashPS(int lookup, int height)
{
CBlockIndex *pb = chainActive.LastTip();
@@ -96,7 +97,7 @@ int64_t GetNetworkHashPS(int lookup, int height)
arith_uint256 workDiff = pb->chainPower.chainWork - pb0->chainPower.chainWork;
int64_t timeDiff = maxTime - minTime;
return (int64_t)(workDiff.getdouble() / timeDiff);
return workDiff.getdouble() / timeDiff;
}
UniValue getlocalsolps(const UniValue& params, bool fHelp, const CPubKey& mypk)