diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 8 | ||||
| -rw-r--r-- | src/common/download.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 3a007c7a0..98d8c6e91 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -39,7 +39,6 @@ #endif #include "string_tools.h" -#include "file_io_utils.h" #include "common/util.h" #include "common/pruning.h" #include "cryptonote_basic/cryptonote_format_utils.h" @@ -4564,12 +4563,11 @@ bool BlockchainLMDB::is_read_only() const uint64_t BlockchainLMDB::get_database_size() const { - uint64_t size = 0; boost::filesystem::path datafile(m_folder); datafile /= CRYPTONOTE_BLOCKCHAINDATA_FILENAME; - if (!epee::file_io_utils::get_file_size(datafile.string(), size)) - size = 0; - return size; + boost::system::error_code ec{}; + const boost::uintmax_t size = boost::filesystem::file_size(datafile, ec); + return (ec ? 0 : static_cast<uint64_t>(size)); } void BlockchainLMDB::fixup() diff --git a/src/common/download.cpp b/src/common/download.cpp index 01d4a9aab..e377be266 100644 --- a/src/common/download.cpp +++ b/src/common/download.cpp @@ -30,7 +30,6 @@ #include <atomic> #include <boost/filesystem.hpp> #include <boost/thread/thread.hpp> -#include "file_io_utils.h" #include "net/http_client.h" #include "download.h" @@ -73,8 +72,11 @@ namespace tools { boost::unique_lock<boost::mutex> lock(control->mutex); std::ios_base::openmode mode = std::ios_base::out | std::ios_base::binary; - uint64_t existing_size = 0; - if (epee::file_io_utils::get_file_size(control->path, existing_size) && existing_size > 0) + boost::system::error_code ec{}; + uint64_t existing_size = static_cast<uint64_t>(boost::filesystem::file_size(control->path, ec)); + if (ec) + existing_size = 0; + if (existing_size > 0) { MINFO("Resuming downloading " << control->uri << " to " << control->path << " from " << existing_size); mode |= std::ios_base::app; |
