Skip to content

Commit

Permalink
5.4.3.0 2023-04-05, leisure
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jamescowens committed Apr 5, 2023
2 parents f48d416 + a0a9ba8 commit 57b2ff9
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 11 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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/])
Expand Down
12 changes: 12 additions & 0 deletions share/setup.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 ${|}
Expand All @@ -184,6 +194,8 @@ Function .onInit
${EndIf}
ExecWait "$1 _?=$0" $0
${IfThen} $0 != 0 ${|} Abort ${|}
end:
Abort
FunctionEnd

# Uninstaller functions
Expand Down
4 changes: 1 addition & 3 deletions src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ template <typename Data>
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;
Expand Down
23 changes: 17 additions & 6 deletions src/gridcoin/backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "wallet/wallet.h"
#include "util.h"
#include "util/time.h"
#include <filesystem>

#include <boost/date_time/posix_time/posix_time.hpp>

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 57b2ff9

Please sign in to comment.