Skip to content

Commit a192636

Browse files
committed
-blocksdir: keep blockindex leveldb database in datadir
1 parent f38e4fd commit a192636

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/txdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ size_t CCoinsViewDB::EstimateSize() const
147147
return db.EstimateSize(DB_COIN, (char)(DB_COIN+1));
148148
}
149149

150-
CBlockTreeDB::CBlockTreeDB(size_t nCacheSize, bool fMemory, bool fWipe) : CDBWrapper(GetBlocksDir() / "index", nCacheSize, fMemory, fWipe) {
150+
CBlockTreeDB::CBlockTreeDB(size_t nCacheSize, bool fMemory, bool fWipe) : CDBWrapper(gArgs.IsArgSet("-blocksdir") ? GetDataDir() / "blocks" / "index" : GetBlocksDir() / "index", nCacheSize, fMemory, fWipe) {
151151
}
152152

153153
bool CBlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo &info) {

test/functional/feature_blocksdir.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def run_test(self):
2727
self.start_node(0, ["-blocksdir="+self.options.tmpdir+ "/blocksdir"])
2828
self.log.info("mining blocks..")
2929
self.nodes[0].generate(10)
30-
assert(os.path.isfile(self.options.tmpdir+ "/blocksdir/regtest/blocks/blk00000.dat"))
31-
assert(os.path.isdir(self.options.tmpdir+ "/blocksdir/regtest/blocks/index"))
30+
assert(os.path.isfile(os.path.join(self.options.tmpdir, "blocksdir", "regtest", "blocks", "blk00000.dat")))
31+
assert(os.path.isdir(os.path.join(self.options.tmpdir, "node0", "regtest", "blocks", "index")))
3232

3333
if __name__ == '__main__':
3434
BlocksdirTest().main()

0 commit comments

Comments
 (0)