diff --git a/CHANGELOG.md b/CHANGELOG.md index 979849b008..c353684138 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/). +## [5.4.3.0] 2023-04-05, leisure + +### Added + - install: Enhance windows installer - detect running gridcoinresearch(d).exe and ask to close before continuing #2672 (@jamescowens) + - gui: Add one minute QTimer to update beacon age/expiration in tooltip #2671 (@jamescowens) + +### Changed +none + +### Removed +none + +### Fixed + - util: Implement workaround for backupwallet to deal with Boost 1.74 regression on copy_file #2669 (@jamescowens) + - banman: use GetPerformanceCounter instead of GetRandBytes #2668 (@div72) + ## [5.4.2.0] 2023-03-26, leisure, "LaVerne" ### Added diff --git a/configure.ac b/configure.ac index a91254db1a..5b123885ca 100755 --- a/configure.ac +++ b/configure.ac @@ -2,10 +2,10 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 5) define(_CLIENT_VERSION_MINOR, 4) -define(_CLIENT_VERSION_REVISION, 2) +define(_CLIENT_VERSION_REVISION, 3) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) -define(_COPYRIGHT_YEAR, 2022) +define(_COPYRIGHT_YEAR, 2023) define(_COPYRIGHT_HOLDERS,[The %s developers]) define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Gridcoin]]) AC_INIT([Gridcoin],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/gridcoin/Gridcoin-Research/issues],[gridcoin],[https://gridcoin.us/]) diff --git a/share/setup.nsi.in b/share/setup.nsi.in index eef98f6810..a3f070dfca 100644 --- a/share/setup.nsi.in +++ b/share/setup.nsi.in @@ -168,6 +168,16 @@ Function .onInit Abort ${EndIf} !endif + loop: + ExpandEnvStrings $1 "%COMSPEC%" + ExecWait '$1 /C "$\"$SYSDIR\tasklist.exe$\" /NH /FI $\"IMAGENAME eq @GRIDCOIN_GUI_NAME@@EXEEXT@$\" | $\"$SYSDIR\find.exe$\" /I $\"@GRIDCOIN_GUI_NAME@@EXEEXT@$\""' $0 + StrCmp $0 0 0 notRunning_gui + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'The Gridcoin wallet (@GRIDCOIN_GUI_NAME@@EXEEXT@) is running. Please close before continuing.' IDOK loop IDCANCEL end + notRunning_gui: + ExecWait '$1 /C "$\"$SYSDIR\tasklist.exe$\" /NH /FI $\"IMAGENAME eq @GRIDCOIN_DAEMON_NAME@@EXEEXT@$\" | $\"$SYSDIR\find.exe$\" /I $\"@GRIDCOIN_DAEMON_NAME@@EXEEXT@$\""' $0 + StrCmp $0 0 0 notRunning_daemon + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'The Gridcoin wallet daemon (@GRIDCOIN_DAEMON_NAME@@EXEEXT@) is running. Please close before continuing.' IDOK loop IDCANCEL end + notRunning_daemon: ; Check for HKCU Path registry and prompt for uninstallation if found ReadRegStr $0 HKCU "${REGKEY}" "Path" ${IfThen} $0 == "" ${|} Return ${|} @@ -184,6 +194,8 @@ Function .onInit ${EndIf} ExecWait "$1 _?=$0" $0 ${IfThen} $0 != 0 ${|} Abort ${|} + end: + Abort FunctionEnd # Uninstaller functions diff --git a/src/addrdb.cpp b/src/addrdb.cpp index c40d55a17c..c16078c41a 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -40,9 +40,7 @@ template bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data) { // Generate random temporary filename - unsigned short randv = 0; - GetRandBytes((unsigned char*)&randv, sizeof(randv)); - std::string tmpfn = strprintf("%s.%04x", prefix, randv); + std::string tmpfn = strprintf("%s.%" PRIx64, prefix, GetPerformanceCounter()); // open temp output file, and associate with CAutoFile fs::path pathTmp = GetDataDir() / tmpfn; diff --git a/src/gridcoin/backup.cpp b/src/gridcoin/backup.cpp index c29b12d1db..de5456fb26 100644 --- a/src/gridcoin/backup.cpp +++ b/src/gridcoin/backup.cpp @@ -8,6 +8,7 @@ #include "wallet/wallet.h" #include "util.h" #include "util/time.h" +#include #include @@ -117,11 +118,16 @@ bool GRC::BackupConfigFile(const std::string& strDest) fs::create_directories(ConfigTarget.parent_path()); try { - #if BOOST_VERSION >= 107400 - fs::copy_file(ConfigSource, ConfigTarget, fs::copy_options::overwrite_existing); - #else - fs::copy_file(ConfigSource, ConfigTarget, fs::copy_option::overwrite_if_exists); - #endif +#if BOOST_VERSION > 107400 + fs::copy_file(ConfigSource, ConfigTarget, fs::copy_options::overwrite_existing); +#elif BOOST_VERSION == 107400 + // This is a workaround for Boost 1.74's problem with copy_file when the target is inside a symlink. + std::filesystem::path StdConfigSource = ConfigSource.wstring(); + std::filesystem::path StdConfigTarget = strDest; + std::filesystem::copy_file(StdConfigSource, StdConfigTarget, std::filesystem::copy_options::overwrite_existing); +#else + fs::copy_file(ConfigSource, ConfigTarget, fs::copy_option::overwrite_if_exists); +#endif LogPrintf("BackupConfigFile: Copied gridcoinresearch.conf to %s", ConfigTarget.string()); return true; } @@ -156,8 +162,13 @@ bool GRC::BackupWallet(const CWallet& wallet, const std::string& strDest) WalletTarget /= wallet.strWalletFile; try { -#if BOOST_VERSION >= 107400 +#if BOOST_VERSION > 107400 fs::copy_file(WalletSource, WalletTarget, fs::copy_options::overwrite_existing); +#elif BOOST_VERSION == 107400 + // This is a workaround for Boost 1.74's problem with copy_file when the target is inside a symlink. + std::filesystem::path StdWalletSource = WalletSource.wstring(); + std::filesystem::path StdWalletTarget = strDest; + std::filesystem::copy_file(StdWalletSource, StdWalletTarget, std::filesystem::copy_options::overwrite_existing); #else fs::copy_file(WalletSource, WalletTarget, fs::copy_option::overwrite_if_exists); #endif diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 7a382f855d..becaeb4abd 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -828,6 +828,15 @@ void BitcoinGUI::setResearcherModel(ResearcherModel *researcherModel) updateBeaconIcon(); connect(researcherModel, &ResearcherModel::beaconChanged, this, &BitcoinGUI::updateBeaconIcon); + + QTimer *beacon_status_update_timer = new QTimer(this); + + // This timer trigger is to support updating the beacon age and time to expiration in the tooltip. + // Once a minute is sufficient. + connect(beacon_status_update_timer, &QTimer::timeout, this, &BitcoinGUI::updateBeaconIcon); + + // Check every minute + beacon_status_update_timer->start(1000 * 60); } void BitcoinGUI::setMRCModel(MRCModel *mrcModel)