-
Notifications
You must be signed in to change notification settings - Fork 38.8k
wallet: Fix wallet directory initialization #28514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Looks like the tests fail? |
ac74173 to
3b7d0e9
Compare
3b7d0e9 to
4544d03
Compare
|
@MarcoFalke not sure why this test is failing, since it passes locally |
|
The CI task that failed is named "no wallet". This means, to reproduce the failure, you will have to compile without a wallet and run the test. |
4544d03 to
9c3b79e
Compare
|
This seems promising, but it isn't exactly implementing what's described in #16220 (comment) or the PR description so it has a different set of advantages and disadvantages. The difference between code and PR description is that code is not implementing: "If list is empty wallet should create Maybe this is ok, and the PR is still worthwhile, because it at least it simplifies the node code, even if it doesn't simplify the wallet code, and it makes the separation cleaner because node code no longer explicitly needs to create the "wallets" directory and can avoid creating it if the wallet is disabled. Another consequence of not creating Other notes about the PR:
|
9c3b79e to
76d8957
Compare
|
Accidentally closed the PR |
e37e60f to
6b4ad10
Compare
6b4ad10 to
17b4955
Compare
|
I have updated the PR and moved the wallet directory initialization code to VerifyWallets() I have also added tests for the various init scenarios and removed the remaining TryCreateDirectories from QT The tests changed in this PR are a reflection of the changes in the logic of the wallet dir init code as suggested, such as the I removed the symlink code (see screenshot attached) since it makes tests in wallet_multiwallet.py fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "Fix wallet directory initialization" (17b4955e4b1e4f02f00a948b432f18caa9b250a5)
Is there a reason this test is changing? I'd expect the change to be backwards compatible so existing tests should not need to change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanofsky This is because of the change in wallet dir init logic. The wallet/ dir is created when a new node is started and no wallet is detected in data_dir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "Fix wallet directory initialization" (17b4955e4b1e4f02f00a948b432f18caa9b250a5)
Is there a reason this test is changing? I'd expect the change to be backwards compatible so existing tests should not need to change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also because of the change in the wallet dir init logic. The wallet/ dir is created when a new node is started and no wallet is detected in data_dir
util/system datadir code should not care about wallets or create any wallet paths If -walletdir is specified, wallet init code should use that directory If -walletdir is specified and path is not a directory, return a fatal error If -walletdir is not specified, use <datadir>/wallets if it is directory. If -walletdir is not specified and <datadir>/wallets does not exist: <datadir>/wallets wallet should call ListWalletDir ListDatabases on <datadir> If list is empty wallet should create <datadir>/wallets as a directory, otherwise it should create it as a symlink pointing to . discussion at bitcoin#16220
17b4955 to
dfe62e9
Compare
sedited
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
|
Could rebase for fresh CI, if still relevant? |
|
The PR didn't seem to attract much attention in the past. Also, the issue seems not important enough right now to keep it sitting around idle in the list of open PRs. Closing due to lack of interest. |


Fixes #16220, see #16220 (comment)