Skip to content
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

Backport abc2bch new wallets in default dir #2212

Conversation

gasull
Copy link

@gasull gasull commented Mar 25, 2021

Backport of Bitcoin-ABC#15 .


This change is Reviewable

PiRK and others added 2 commits March 25, 2021 05:53
The previous behavior was to create new wallets in the same directory as the current wallet, even if this wallet was a wallet open in an arbitrary external path.

This changes the behavior to use either the wallet path explicitely specified on the command line (-w or --wallet argument) or the default wallet directory in the user's data directory.

Remove also a piece of code providing compatiblity with an ancient version of electrum (1.9 released in 2013).

Closes Electron-Cash#10

Test Plan:
Run `electrum-abc`, open a wallet file in an external directory unrelated to electrum-abc (for instance in the Electron Cash data directory), then create a new wallet and verify that it is created in the normal .electrum-abc directory.
@gasull
Copy link
Author

gasull commented Mar 26, 2021

I didn't explain what this PR is supposed to fix. Here it is. From Bitcoin-ABC#10 (comment) :

The get_new_wallet_path (https://github.com/Bitcoin-ABC/ElectrumABC/blob/master/electroncash_gui/qt/__init__.py#L569) calls a get_wallet_folder method which uses in turns config.get_wallet_path, which seems to return the path to the current default wallet. The new wallet will be saved wherever the current default-wallet is saved.

The "default wallet" seems to be the last wallet that was opened (including external wallets open via the File -> Open menu).

It think a better behavior would be to either always create the new wallet in the normal user dir, or ask the user. Unless the user started the program with a different wallet path explicitly requested on the command line.

But although this was happening in Electrum ABC, it isn't happening for me in Electron Cash on the main branch. The wallet is always created in ~/.electroncash/testnet/wallets/.

I'm closing this.

@gasull gasull closed this Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants