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

detect empty wallet or create new wallet #40

Open
scravy opened this issue Aug 27, 2018 · 3 comments
Open

detect empty wallet or create new wallet #40

scravy opened this issue Aug 27, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@scravy
Copy link
Member

scravy commented Aug 27, 2018

From a comment in #37

[We are] trying to use as much bitcoin functionality as possible. Bitcoins CWallet already has methods to set the master key but I do suspect it was not their intention for them to be used /after/ a wallet has been created already. When the node comes up it automatically creates a wallet. Upon creation the wallet is preseeded with a list of reserve keys. It is thus tricky to distinguish a newly created wallet from a wallet which is already in use. Nevertheless you could import a new masterkey into an already used wallet, which is why setting a new masterkey will automatically backup your existing wallet (although in most cases this will be an empty wallet).

Ways to solve this:

  • create and open a completely new wallet
  • detect whether current wallet is used, if used -> fail, of not used -> replace master key
@cmihai
Copy link
Member

cmihai commented Jan 24, 2019

I'm in favor of the second solution, with the addition of a "force" argument to importmasterkey which will replace the key unconditionally.

We could detect that a wallet is unused if the mapAddressBook collection is empty, for example.

@dtr-org dtr-org deleted a comment from mergeable bot Jan 24, 2019
@dtr-org dtr-org deleted a comment from mergeable bot Jan 24, 2019
@thothd thothd modified the milestones: 0.1, 1.0 Jan 24, 2019
cmihai added a commit that referenced this issue Feb 20, 2019
This commit moves the wallet backup location for `importmasterkey` from the current directory to the Unit-e daemon's datadir.

Tangentially related to #40.

Signed-off-by: Mihai Ciumeica <[email protected]>
@scravy
Copy link
Member Author

scravy commented Feb 22, 2019

Related: bitcoin/bitcoin#15454

@cmihai
Copy link
Member

cmihai commented Mar 19, 2019

Also related: bitcoin/bitcoin@7687f78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants