Skip to content

Commit

Permalink
-blocksdir: keep blockindex leveldb database in datadir
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschnelli authored and furszy committed Apr 28, 2021
1 parent 3054076 commit a4ff899
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/txdb.cpp
Expand Up @@ -159,7 +159,7 @@ size_t CCoinsViewDB::EstimateSize() const
return db.EstimateSize(DB_COIN, (char)(DB_COIN+1));
}

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

Expand Down
4 changes: 2 additions & 2 deletions test/functional/feature_blocksdir.py
Expand Up @@ -27,8 +27,8 @@ def run_test(self):
self.start_node(0, ["-blocksdir="+self.options.tmpdir+ "/blocksdir"])
self.log.info("mining blocks..")
self.nodes[0].generate(10)
assert(os.path.isfile(self.options.tmpdir+ "/blocksdir/regtest/blocks/blk00000.dat"))
assert(os.path.isdir(self.options.tmpdir+ "/blocksdir/regtest/blocks/index"))
assert(os.path.isfile(os.path.join(self.options.tmpdir, "blocksdir", "regtest", "blocks", "blk00000.dat")))
assert(os.path.isdir(os.path.join(self.options.tmpdir, "node0", "regtest", "blocks", "index")))

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

0 comments on commit a4ff899

Please sign in to comment.