Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 0 additions & 118 deletions build-aux/m4/ax_boost_chrono.m4

This file was deleted.

2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_native
export DOCKER_NAME_TAG=ubuntu:20.04
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4 libcurl4-openssl-dev"
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4 libcurl4-openssl-dev"
export RUN_UNIT_TESTS=true
# export RUN_FUNCTIONAL_TESTS=false
# export RUN_SECURITY_TESTS="true"
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_old.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_native_old
export DOCKER_NAME_TAG=ubuntu:18.04
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4-openssl-dev"
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4-openssl-dev"
export RUN_UNIT_TESTS=true
# export RUN_FUNCTIONAL_TESTS=false
# export RUN_SECURITY_TESTS="true"
Expand Down
31 changes: 1 addition & 30 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,6 @@ AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_THREAD
AX_BOOST_CHRONO
AX_BOOST_ZLIB
AX_BOOST_IOSTREAMS

Expand All @@ -949,7 +948,7 @@ dnl counter implementations. In 1.63 and later the std::atomic approach is defau
m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro
BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS"

BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB"
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_IOSTREAMS_LIB $BOOST_THREAD_LIB $BOOST_ZLIB_LIB"
fi

if test x$use_reduce_exports = xyes; then
Expand Down Expand Up @@ -989,34 +988,6 @@ if test x$use_tests = xyes; then
fi
fi

if test x$use_boost = xyes; then

BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_ZLIB_LIB $BOOST_IOSTREAMS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB $BOOST_ZLIB_LIB"

dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep.
dnl Use sleep_for if a working version is available. If not, abort.
TEMP_LIBS="$LIBS"
LIBS="$BOOST_LIBS $LIBS"
TEMP_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <boost/thread/thread.hpp>
#include <boost/version.hpp>
]],[[
boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
]])],
[boost_sleep=yes;
AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
[boost_sleep=no])
LIBS="$TEMP_LIBS"
CPPFLAGS="$TEMP_CPPFLAGS"

if test x$boost_sleep != xyes; then
AC_MSG_ERROR(No working boost sleep implementation found.)
fi

fi

PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
PKG_CHECK_MODULES([LIBZIP], [libzip],,[AC_MSG_ERROR(libzip not found.)])
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/boost.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ifneq (,$(findstring clang,$($(package)_cxx)))
$(package)_toolset_$(host_os)=clang
endif
$(package)_archiver_$(host_os)=$($(package)_ar)
$(package)_config_libraries=chrono,filesystem,system,thread,test,iostreams
$(package)_config_libraries=filesystem,system,thread,test,iostreams
$(package)_cxxflags=-std=c++17 -fvisibility=hidden
$(package)_cxxflags_linux=-fPIC
$(package)_cxxflags_android=-fPIC
Expand Down
2 changes: 1 addition & 1 deletion doc/build-openbsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ patch -p0 < /usr/ports/devel/boost/patches/patch-boost_test_impl_execution_monit
# Build w/ minimum configuration necessary for bitcoin
echo 'using gcc : : eg++ : <cxxflags>"-fvisibility=hidden -fPIC" <linkflags>"" <archiver>"ar" <striper>"strip" <ranlib>"ranlib" <rc>"" : ;' > user-config.jam
config_opts="runtime-link=shared threadapi=pthread threading=multi link=static variant=release --layout=tagged --build-type=complete --user-config=user-config.jam -sNO_BZIP2=1"
./bootstrap.sh --without-icu --with-libraries=chrono,filesystem,system,thread,test
./bootstrap.sh --without-icu --with-libraries=filesystem,system,thread,test
./b2 -d2 -j2 -d1 ${config_opts} --prefix=${BOOST_PREFIX} stage
./b2 -d0 -j4 ${config_opts} --prefix=${BOOST_PREFIX} install
```
Expand Down
6 changes: 3 additions & 3 deletions doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Options when installing required Boost library files:
individual boost development packages, so the following can be used to only
install necessary parts of boost:

sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libboost-iostreams-dev libcurl4-gnutls-dev
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libboost-iostreams-dev libcurl4-gnutls-dev

2. If that doesn't work, you can install all boost development packages with:

Expand Down Expand Up @@ -164,11 +164,11 @@ install necessary parts of boost:

Tumbleweed:

sudo zypper install libboost_system1_*_0-devel libboost_filesystem1_*_0-devel libboost_chrono1_*_0-devel libboost_test1_*_0-devel libboost_thread1_*_0-devel
sudo zypper install libboost_system1_*_0-devel libboost_filesystem1_*_0-devel libboost_test1_*_0-devel libboost_thread1_*_0-devel

Leap:

sudo zypper install libboost_system1_61_0-devel libboost_filesystem1_61_0-devel libboost_chrono1_61_0-devel libboost_test1_61_0-devel libboost_thread1_61_0-devel
sudo zypper install libboost_system1_61_0-devel libboost_filesystem1_61_0-devel libboost_test1_61_0-devel libboost_thread1_61_0-devel

2. If that doesn't work, you can install all boost development packages with:

Expand Down
2 changes: 0 additions & 2 deletions gridcoinresearch.pro
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,6 @@ LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lcurl -lzip
windows:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX -lcurl -lzip

windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX

contains(RELEASE, 1) {
!windows:!macx {
# Linux: turn dynamic linking back on for c/c++ runtime libraries
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ GRIDCOIN_CORE_H = \
support/cleanse.h \
support/lockedpool.h \
sync.h \
threadinterrupt.h \
threadsafety.h \
tinyformat.h \
txdb.h \
Expand Down Expand Up @@ -268,6 +269,7 @@ GRIDCOIN_CORE_CPP = addrdb.cpp \
support/cleanse.cpp \
support/lockedpool.cpp \
sync.cpp \
threadinterrupt.cpp \
txdb-leveldb.cpp \
uint256.cpp \
util/settings.cpp \
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ GRIDCOIN_TESTS =\
test/multisig_tests.cpp \
test/netbase_tests.cpp \
test/rpc_tests.cpp \
test/scheduler_tests.cpp \
test/script_p2sh_tests.cpp \
test/script_tests.cpp \
test/serialize_tests.cpp \
Expand Down
4 changes: 2 additions & 2 deletions src/gridcoin/backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void GRC::RunBackupJob()
return;
}

const int64_t now = GetSystemTimeInSeconds();
const int64_t now = GetTimeSeconds();

static const int64_t interval = GetBackupInterval();
static int64_t last_backup_time = pwalletMain->GetLastBackupTime();
Expand Down Expand Up @@ -234,7 +234,7 @@ bool GRC::MaintainBackups(fs::path wallet_backup_path, std::vector<std::string>
"The retention will follow whichever results in the greater number of files "
"retained.", retention_by_num, retention_by_days);

int64_t retention_cutoff_time = GetSystemTimeInSeconds() - retention_by_days * 86400;
int64_t retention_cutoff_time = GetTimeSeconds() - retention_by_days * 86400;

// Iterate through the log archive directory and delete the oldest files beyond the retention rules.
// The names are in format <file type>-YYYY-MM-DDTHH-MM-SS for the backup entries, so iterate
Expand Down
16 changes: 8 additions & 8 deletions src/gridcoin/gridcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void ScheduleBackups(CScheduler& scheduler)
// a cycle when it encounters lock contention or when a cycle occurs
// sooner than the requested interval:
//
scheduler.scheduleEvery(RunBackupJob, GetBackupInterval() * 1000 / 4);
scheduler.scheduleEvery(RunBackupJob, std::chrono::seconds{GetBackupInterval() / 4});

// Run the backup job on start-up in case the wallet started after a
// long period of downtime. Some usage patterns may cause the wallet
Expand All @@ -382,7 +382,7 @@ void ScheduleBackups(CScheduler& scheduler)
// the wallet contains a stored backup timestamp later than the next
// scheduled backup interval:
//
scheduler.scheduleFromNow(RunBackupJob, 60 * 1000);
scheduler.scheduleFromNow(RunBackupJob, std::chrono::seconds{60});
}

//!
Expand Down Expand Up @@ -414,19 +414,19 @@ void ScheduleUpdateChecks(CScheduler& scheduler)

scheduler.scheduleEvery([]{
g_UpdateChecker->ScheduledUpdateCheck();
}, hours * 60 * 60 * 1000);
}, std::chrono::hours{hours});

// Schedule a start-up check one minute from now:
scheduler.scheduleFromNow([]{
g_UpdateChecker->ScheduledUpdateCheck();
}, 60 * 1000);
}, std::chrono::minutes{1});
}

void ScheduleBeaconDBPassivation(CScheduler& scheduler)
{
// Run beacon database passivation every 5 minutes. This is a very thin call most of the time.
// Please see the PassivateDB function and passivate_db.
scheduler.scheduleEvery(BeaconRegistry::RunBeaconDBPassivation, 5 * 60 * 1000);
scheduler.scheduleEvery(BeaconRegistry::RunBeaconDBPassivation, std::chrono::minutes{5});
}
} // Anonymous namespace

Expand Down Expand Up @@ -474,7 +474,7 @@ void GRC::CloseResearcherRegistryFile()

void GRC::ScheduleBackgroundJobs(CScheduler& scheduler)
{
scheduler.schedule(CheckBlockIndexJob);
scheduler.schedule(CheckBlockIndexJob, std::chrono::system_clock::now());

// Primitive, but this is what the scraper does in the scraper housekeeping
// loop. It checks to see if the logs need to be archived by default every
Expand All @@ -485,9 +485,9 @@ void GRC::ScheduleBackgroundJobs(CScheduler& scheduler)
scheduler.scheduleEvery([]{
fs::path plogfile_out;
LogInstance().archive(false, plogfile_out);
}, 300 * 1000);
}, std::chrono::seconds{300});

scheduler.scheduleEvery(Researcher::RunRenewBeaconJob, 4 * 60 * 60 * 1000);
scheduler.scheduleEvery(Researcher::RunRenewBeaconJob, std::chrono::hours{4});

ScheduleBackups(scheduler);
ScheduleUpdateChecks(scheduler);
Expand Down
Loading