diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml
index 992d493..a80f70e 100644
--- a/.github/workflows/build-all.yml
+++ b/.github/workflows/build-all.yml
@@ -9,7 +9,7 @@ on:
workflow_dispatch:
env:
- VERSION: "5.3.4"
+ VERSION: "5.3.5"
jobs:
build-windows-qt:
diff --git a/src/clientversion.h b/src/clientversion.h
index a6554d1..5782cf6 100644
--- a/src/clientversion.h
+++ b/src/clientversion.h
@@ -8,7 +8,7 @@
// These need to be macros, as version.cpp's and triangles-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 5
#define CLIENT_VERSION_MINOR 3
-#define CLIENT_VERSION_REVISION 4
+#define CLIENT_VERSION_REVISION 5
#define CLIENT_VERSION_BUILD 0
// Converts the parameter X to a string after macro replacement on X has been performed.
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index f67f51c..8a8ffe8 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -70,12 +70,20 @@ void ClientModel::updateTimer()
int newNumBlocks = getNumBlocks();
int newNumBlocksOfPeers = getNumBlocksOfPeers();
- // Always emit during IBD so the speed/ETA display stays live
- if(cachedNumBlocks != newNumBlocks || cachedNumBlocksOfPeers != newNumBlocksOfPeers
- || newNumBlocks < newNumBlocksOfPeers)
+ // Always emit when values change or during IBD.
+ // Also emit every ~30 seconds even when idle so setNumBlocks() can
+ // re-evaluate sync status (e.g. when a new block arrives after a long gap).
+ static int64_t nLastEmit = 0;
+ int64_t nNow = GetTime();
+ bool fChanged = (cachedNumBlocks != newNumBlocks || cachedNumBlocksOfPeers != newNumBlocksOfPeers);
+ bool fCatchingUp = (newNumBlocks < newNumBlocksOfPeers);
+ bool fPeriodicRefresh = (nNow - nLastEmit >= 30);
+
+ if(fChanged || fCatchingUp || fPeriodicRefresh)
{
cachedNumBlocks = newNumBlocks;
cachedNumBlocksOfPeers = newNumBlocksOfPeers;
+ nLastEmit = nNow;
emit numBlocksChanged(newNumBlocks, newNumBlocksOfPeers);
}
diff --git a/src/qt/trianglesgui.cpp b/src/qt/trianglesgui.cpp
index 01ef56d..065d2ec 100644
--- a/src/qt/trianglesgui.cpp
+++ b/src/qt/trianglesgui.cpp
@@ -904,9 +904,10 @@ void TrianglesGUI::setNumBlocks(int count, int nTotalBlocks)
}
// Set icon state: spinning if catching up, tick otherwise.
- // Use a generous threshold (6 hours) for PoS chains where block intervals
- // can be long during difficulty adjustment with few stakers.
- if(secs < 6*60*60 && count >= nTotalBlocks)
+ // For PoS chains with few stakers, blocks can be hours or days apart.
+ // Sync status is based purely on block count - NOT block timestamp.
+ // A stale chain (no recent blocks) is still "synced" if we have all blocks.
+ if(count >= nTotalBlocks)
{
tooltip = tr("Up to date") + QString(".
") + tooltip;
labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
diff --git a/src/version.h b/src/version.h
index b124feb..79d9b55 100644
--- a/src/version.h
+++ b/src/version.h
@@ -53,7 +53,7 @@ static const int MEMPOOL_GD_VERSION = 60002;
#define DISPLAY_VERSION_MAJOR 5
#define DISPLAY_VERSION_MINOR 3
-#define DISPLAY_VERSION_REVISION 4
+#define DISPLAY_VERSION_REVISION 5
#define DISPLAY_VERSION_BUILD 0
#endif
diff --git a/src/wallet.h b/src/wallet.h
index fa2dab4..f7bcf75 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -7,6 +7,7 @@
#include
#include
+#include
#include
@@ -204,9 +205,8 @@ public:
bool CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int64_t nSearchInterval, int64_t nFees, CTransaction& txNew, CKey& key);
// Cached staking info - updated by the staking thread, read by the UI thread.
- // Access is safe without locks: written atomically by the miner, read by UI for display only.
- volatile uint64_t nCachedStakeWeight;
- volatile int64_t nCachedStakeWeightTime; // GetTime() when last updated
+ std::atomic nCachedStakeWeight;
+ std::atomic nCachedStakeWeightTime; // GetTime() when last updated
std::string SendMoney(CScript scriptPubKey, int64_t nValue, std::string& sNarr, CWalletTx& wtxNew, bool fAskFee=false);
std::string SendMoneyToDestination(const CTxDestination& address, int64_t nValue, std::string& sNarr, CWalletTx& wtxNew, bool fAskFee=false);