Skip to content

Commit

Permalink
Clearer message when migration runs for first time users
Browse files Browse the repository at this point in the history
  • Loading branch information
j-berman committed Dec 30, 2021
1 parent 5090652 commit e8812bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/db/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,9 @@ namespace db

void migrate_0_1(MDB_txn& txn, tables_ const& tables)
{
MINFO("Migrating from db version 0 to 1...");

// All addresses in version 0 were primary addresses, but didn't have a bool `is_subaddress`.
// This migration adds a falsey `is_subaddress` to every account_address stored in the db.
// If no addresses are stored, this wraps up quickly.
struct account_address_v0
{
crypto::public_key view_public; //!< Must be first for LMDB optimizations.
Expand Down Expand Up @@ -544,6 +543,9 @@ namespace db

void migrate(MDB_txn& txn, tables_ const& tables, const unsigned oldversion)
{
if (oldversion == 0)
MINFO("Setting up database...");

if (oldversion < 1)
migrate_0_1(txn, tables);
}
Expand Down

0 comments on commit e8812bd

Please sign in to comment.