From a18102ac2c76ed2c6a8ae742df7630e8f09cf9e6 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 10 Nov 2014 15:40:17 -0800 Subject: [PATCH] read leveldb index. --- src/bitcoindjs.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 1b3c7cfe..71ece01e 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -5688,12 +5688,15 @@ read_addr(const std::string addr) { TwoPartComparator cmp; options.comparator = &cmp; +#ifdef USE_LDB_FILES unsigned int nFile = 0; unsigned int tryFiles = 0xffffffff; - for (; nFile < tryFiles; nFile++) { const boost::filesystem::path path = GetDataDir() / "blocks" / strprintf("%s%05u.dat", "blk", nFile); - +#else + { + const boost::filesystem::path path = GetDataDir() / "blocks" / "index"; +#endif if (fMemory) { penv = leveldb::NewMemEnv(leveldb::Env::Default()); options.env = penv; @@ -5775,7 +5778,11 @@ found: } delete it; +#ifdef USE_LDB_FILES } +#else + } +#endif return head; }