mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-29 18:53:14 +00:00
db_lmdb: error out if the db needs migration in read only mode
This commit is contained in:
parent
a9e03ebc6a
commit
dffec2587f
1 changed files with 9 additions and 0 deletions
|
@ -1345,6 +1345,15 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags)
|
||||||
#if VERSION > 0
|
#if VERSION > 0
|
||||||
else if (db_version < VERSION)
|
else if (db_version < VERSION)
|
||||||
{
|
{
|
||||||
|
if (mdb_flags & MDB_RDONLY)
|
||||||
|
{
|
||||||
|
txn.abort();
|
||||||
|
mdb_env_close(m_env);
|
||||||
|
m_open = false;
|
||||||
|
MFATAL("Existing lmdb database needs to be converted, which cannot be done on a read-only database.");
|
||||||
|
MFATAL("Please run monerod once to convert the database.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Note that there was a schema change within version 0 as well.
|
// Note that there was a schema change within version 0 as well.
|
||||||
// See commit e5d2680094ee15889934fe28901e4e133cda56f2 2015/07/10
|
// See commit e5d2680094ee15889934fe28901e4e133cda56f2 2015/07/10
|
||||||
// We don't handle the old format previous to that commit.
|
// We don't handle the old format previous to that commit.
|
||||||
|
|
Loading…
Reference in a new issue