aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2016-03-30 20:36:26 +0100
committerHoward Chu <hyc@symas.com>2016-03-30 20:37:28 +0100
commitefbdde2c66234692677016fb6585b7078db1660d (patch)
tree87caa0b196dea72855ad41a81690518d364b6107 /src/blockchain_db
parentMerge pull request #770 (diff)
downloadmonero-efbdde2c66234692677016fb6585b7078db1660d.tar.xz
Detect map resize failures
Diffstat (limited to 'src/blockchain_db')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp4
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);