diff options
| author | tobtoht <tob@featherwallet.org> | 2025-01-18 11:09:43 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2025-01-18 11:09:43 +0000 |
| commit | e488bc838a73f238fb31084dad344350c005654e (patch) | |
| tree | 115189053a78e212f862812267a63b8d638d6c0a /src/blockchain_db | |
| parent | 5625ea3a5663126cbf469e65609d2cc2f4f4dc0b (diff) | |
| parent | 36c5987156a31640c4638f1424b98285f6ea4a47 (diff) | |
| download | monzero-core-e488bc838a73f238fb31084dad344350c005654e.tar.gz monzero-core-e488bc838a73f238fb31084dad344350c005654e.tar.xz monzero-core-e488bc838a73f238fb31084dad344350c005654e.zip | |
Merge pull request #9705
36c5987 Fix get_database_size on Windows (iamamyth)
Diffstat (limited to 'src/blockchain_db')
| -rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 8 |
1 files changed, 3 insertions, 5 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() |
