Merge pull request #5155

2c0fc8b4 db_lmdb: fix missing mdb_dbi_close in migration (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2019-02-18 11:15:04 +02:00
commit a8e752d383
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -4355,6 +4355,7 @@ void BlockchainLMDB::migrate_2_3()
throw0(DB_ERROR(lmdb_error("Failed to delete old block_info table: ", result).c_str())); throw0(DB_ERROR(lmdb_error("Failed to delete old block_info table: ", result).c_str()));
RENAME_DB("block_infn"); RENAME_DB("block_infn");
mdb_dbi_close(m_env, m_block_info);
lmdb_db_open(txn, "block_info", MDB_INTEGERKEY | MDB_CREATE | MDB_DUPSORT | MDB_DUPFIXED, m_block_info, "Failed to open db handle for block_infn"); lmdb_db_open(txn, "block_info", MDB_INTEGERKEY | MDB_CREATE | MDB_DUPSORT | MDB_DUPFIXED, m_block_info, "Failed to open db handle for block_infn");
mdb_set_dupsort(txn, m_block_info, compare_uint64); mdb_set_dupsort(txn, m_block_info, compare_uint64);
@ -4514,6 +4515,7 @@ void BlockchainLMDB::migrate_3_4()
throw0(DB_ERROR(lmdb_error("Failed to delete old block_info table: ", result).c_str())); throw0(DB_ERROR(lmdb_error("Failed to delete old block_info table: ", result).c_str()));
RENAME_DB("block_infn"); RENAME_DB("block_infn");
mdb_dbi_close(m_env, m_block_info);
lmdb_db_open(txn, "block_info", MDB_INTEGERKEY | MDB_CREATE | MDB_DUPSORT | MDB_DUPFIXED, m_block_info, "Failed to open db handle for block_infn"); lmdb_db_open(txn, "block_info", MDB_INTEGERKEY | MDB_CREATE | MDB_DUPSORT | MDB_DUPFIXED, m_block_info, "Failed to open db handle for block_infn");
mdb_set_dupsort(txn, m_block_info, compare_uint64); mdb_set_dupsort(txn, m_block_info, compare_uint64);