Merge pull request #778

efbdde2 Detect map resize failures (Howard Chu)
This commit is contained in:
Riccardo Spagni 2016-04-02 12:05:40 +09:00
commit dea1aa75bc
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
1 changed files with 3 additions and 1 deletions

View File

@ -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);