Reserve only one network specific cached path per session#4803
Reserve only one network specific cached path per session#4803jtimon wants to merge 1 commit intobitcoin:masterfrom
Conversation
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4803_b4ad217d8f6e9beb5268e27ba77a105a20a7f2f4/ for binaries and test log. |
|
Looks good to me but you should very carefully test this. The datadir determination is extremely brittle code. Many times, changes such as this have broken something like 'Set the datadir in bitcoin.conf' or |
|
Ok, I though this could be controversial and that's why I separated it. I'll test this within #4804 |
|
The datadir stuff is really overdue for a cleaner rewrite. The caching makes little sense here in the first place. It should simply compute the directory (once!) and store it when the datadir (and the network, for the specific dir) is set, instead of computing it when it is requested and then caching. But this means having to properly define the initialization order :-) I've postponed this myself as this requires a comprehensive test plan first (what are people actually using?). And well, it works* and there are zillions of more serious issues.
|
|
Btw, I know @gmaxwell is interested in removing worthless caching lately... |
One cannot change the network without restarting, so the only positions in the array that are used are the network you selected and CBaseChainParams::MAX_NETWORK_TYPES. Let's simplify and just have positions 0 and 1.