This PR:
- simplifies path argument (
datadir/blocks/index) forCBlockTreeDBconstructor - does not change behavior as
GetBlocksDir()with unset "-blocksdir" returns the same path - improves code readability
This PR:
datadir/blocks/index) for CBlockTreeDB constructorGetBlocksDir() with unset "-blocksdir" returns the same path
This commit does not change behavior as GetBlocksDir() with unset
"-blocksdir" returns the same path.
ping @jonasschnelli
Needs test/functional/feature_blocksdir.py extended to show the change in behavior
Needs
test/functional/feature_blocksdir.pyextended to show the change in behavior
What "the change in behavior"? This PR does not introduce any change in behavior.
ACK c2bb3919a8cc52ea35d424c1f31f9474f1ea4911
144 | @@ -145,7 +145,7 @@ size_t CCoinsViewDB::EstimateSize() const 145 | return db.EstimateSize(DB_COIN, (char)(DB_COIN+1)); 146 | } 147 | 148 | -CBlockTreeDB::CBlockTreeDB(size_t nCacheSize, bool fMemory, bool fWipe) : CDBWrapper(gArgs.IsArgSet("-blocksdir") ? GetDataDir() / "blocks" / "index" : GetBlocksDir() / "index", nCacheSize, fMemory, fWipe) { 149 | +CBlockTreeDB::CBlockTreeDB(size_t nCacheSize, bool fMemory, bool fWipe) : CDBWrapper(GetDataDir() / "blocks" / "index", nCacheSize, fMemory, fWipe) {
Didn't you pick the wrong side here?
Shouldn't this be GetBlocksDir() / "index" instead? Otherwise it seems it's losing the functionality of -blocksdir.
Didn't you pick the wrong side here?
This PR does not introduce any change in behavior.
Shouldn't this be
GetBlocksDir() / "index"instead? Otherwise it seems it's losing the functionality of-blocksdir.
-blocksdir allows to place raw blocks to a large and slow HDD, while it leaves blockindex on a fast SSD.
Ref: #12653
Whoops. Your'ee right. Thanks for the simplification, that's quite sneaky. I was reading it the wrong way around.
In the future let's review more carefully for people to use an explicit if() statement instead of cramming this kind of logic into an initializer.
ACK c2bb3919a8cc52ea35d424c1f31f9474f1ea4911.
ACK c2bb3919a8cc52ea35d424c1f31f9474f1ea4911