noticed blockchain does not synchronize properly

This commit is contained in:
moneroexamples 2016-04-12 18:07:34 +08:00
parent 6fc2bab65b
commit 51c5bd4e67
2 changed files with 9 additions and 1 deletions

View file

@ -38,7 +38,11 @@ namespace xmreg
//db_flags |= MDB_RDONLY; //db_flags |= MDB_RDONLY;
//db_flags |= MDB_NOLOCK; //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; BlockchainDB* db = nullptr;
db = new BlockchainLMDB(); db = new BlockchainLMDB();

View file

@ -61,9 +61,13 @@ namespace xmreg {
//get current server timestamp //get current server timestamp
time_t server_timestamp = std::time(nullptr); time_t server_timestamp = std::time(nullptr);
core_storage->get_db().sync();
// get the current blockchain height. Just to check if it reads ok. // get the current blockchain height. Just to check if it reads ok.
uint64_t height = core_storage->get_current_blockchain_height() - 1; 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 // initalise page tempate map with basic info about blockchain
mstch::map context { mstch::map context {
{"refresh", refresh_page}, {"refresh", refresh_page},