diff --git a/src/MicroCore.cpp b/src/MicroCore.cpp index 7d66e24..713fbdb 100644 --- a/src/MicroCore.cpp +++ b/src/MicroCore.cpp @@ -38,7 +38,11 @@ namespace xmreg //db_flags |= MDB_RDONLY; //db_flags |= MDB_NOLOCK; - db_flags |= MDB_NOSYNC; + //db_flags |= MDB_SYNC; + + uint64_t DEFAULT_FLAGS = MDB_NOMETASYNC | MDB_NORDAHEAD; + + db_flags = DEFAULT_FLAGS; BlockchainDB* db = nullptr; db = new BlockchainLMDB(); diff --git a/src/page.h b/src/page.h index 6c75eb4..7afcbf3 100644 --- a/src/page.h +++ b/src/page.h @@ -61,9 +61,13 @@ namespace xmreg { //get current server timestamp time_t server_timestamp = std::time(nullptr); + core_storage->get_db().sync(); + // get the current blockchain height. Just to check if it reads ok. uint64_t height = core_storage->get_current_blockchain_height() - 1; + fmt::print("Current height: {:d}\n", height); + // initalise page tempate map with basic info about blockchain mstch::map context { {"refresh", refresh_page},