Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

Calling -salvagewallet (CWalletDB::Recover in keys only mode) will result in dropping the information which private key is used for hd key derivation (and also loses the child key counter).

This simple PR would try to keep the hdchain record if it was available during the time when -salvagewallet was called.

@maflcko
Copy link
Member

maflcko commented Jul 9, 2016

Thanks! I can confirm that b993671 fixes the travis failure in #8319.

@maflcko
Copy link
Member

maflcko commented Jul 11, 2016

This feels like a bug fix, which should be release as part of 0.13.0... Am I wrong?

@laanwj laanwj added this to the 0.13.0 milestone Jul 11, 2016
@laanwj
Copy link
Member

laanwj commented Jul 11, 2016

I agree this is a bug fix. I don't think -salvagewallet dropping the master key is in any way expected behavior. Would be nice to have a test for this.

@maflcko
Copy link
Member

maflcko commented Jul 11, 2016

Would be nice to have a test for this.

You can find the test in #8319

@jonasschnelli
Copy link
Contributor Author

[...] I don't think -salvagewallet dropping the master key is in any way expected behavior. [...]

At the moment, the private key itself will not be dropped, only the information which of the private keys is used as HD seed. Without that information, current masters wallet will create another private key and uses this one as the HD seed. This will result in two different HD chains once you call -salvagewallet.

Yes. It's a bugfix and It probably should go into 0.13, though I think #8323 is more important.

@maflcko
Copy link
Member

maflcko commented Jul 13, 2016

utACK b993671

@laanwj laanwj merged commit b993671 into bitcoin:master Jul 14, 2016
laanwj added a commit that referenced this pull request Jul 14, 2016
b993671 [Wallet] keep HD seed during salvagewallet (Jonas Schnelli)
@laanwj
Copy link
Member

laanwj commented Jul 14, 2016

code review ACK b993671

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants