diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-04-02 12:05:40 +0900 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-04-02 12:05:40 +0900 |
commit | dea1aa75bc54958decff796f42e9808e8fa6336a (patch) | |
tree | c08b29819ad3067d5cbcf4bc40e1932eafd0ff52 | |
parent | Merge pull request #777 (diff) | |
parent | Detect map resize failures (diff) | |
download | monero-dea1aa75bc54958decff796f42e9808e8fa6336a.tar.xz |
Merge pull request #778
efbdde2 Detect map resize failures (Howard Chu)
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 9b99520a1..51fba058d 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -377,7 +377,9 @@ void BlockchainLMDB::do_resize(uint64_t increase_size) mdb_txn_safe::wait_no_active_txns(); - mdb_env_set_mapsize(m_env, new_mapsize); + int result = mdb_env_set_mapsize(m_env, new_mapsize); + if (result) + throw0(DB_ERROR(lmdb_error("Failed to set new mapsize: ", result).c_str())); LOG_PRINT_GREEN("LMDB Mapsize increased." << " Old: " << mei.me_mapsize / (1024 * 1024) << "MiB" << ", New: " << new_mapsize / (1024 * 1024) << "MiB", LOG_LEVEL_0); |