Page MenuHomePhabricator

Merge #12560: [wallet] Upgrade path for non-HD wallets to HD
AbandonedPublic

Authored by nakihito on Sep 27 2019, 17:09.

Details

Reviewers
deadalnix
Fabien
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

a8da482 Bump wallet version for pre split keypool (Andrew Chow)
dfcd9f3 Use a keypool of presplit keys after upgrading to hd chain split (Andrew Chow)
5c50e93 Allow -upgradewallet to upgradewallets to HD (Andrew Chow)
2bcf2b5 Test sethdseed (Andrew Chow)
b5ba01a Add 'sethdseed' RPC to initialize or replace HD seed (Chris Moore)
dd3c07a Separate HaveKey function that checks whether a key is in a keystore (Andrew Chow)

Pull request description:

Revival/rebase of #11085

Adds a new command `sethdseed` which allows you to either set or generate a new HD seed to be used. A new keypool can be generated or the original one kept and new keys added to the keypool will come from the new HD seed.

Wallets that are not HD will be upgraded to be version FEATURE_HD_SPLIT when the `sethdseed` RPC command is used.

I have also add some tests for this.

Additionally `-upgradewallet` can now be used to upgrade a wallet from non-HD to HD. When it is used for such an upgrade, the keypool will be regenerated.

Tree-SHA512: e56c792e150590429ac4a1061e8d6f7b20cca06366e184eb9bbade4cd6ae82699a28fe84f87031eadba97ad2c1606517a105f00fb7b45779c979243020071adb

Backport of Core PR12560
https://github.com/bitcoin/bitcoin/pull/12560/

Test Plan
make check
test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR12560
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7625
Build 13290: Bitcoin ABC Buildbot (legacy)
Build 13289: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Sep 27 2019, 17:09

Fixed block comment end tag.

nakihito added inline comments.
src/wallet/rpcwallet.cpp
4364 ↗(On Diff #13257)

Wallet pointers were changed to shared_ptr in D4134

deadalnix requested changes to this revision.Sep 28 2019, 14:43

This patch contains at least one serious blunder. In addition, the fact that the blunder passed through shows that the test plan is inadequate.

src/keystore.h
91

Relayout

src/wallet/rpcwallet.cpp
4362

Why not static?

4448

braces

src/wallet/wallet.h
89

...

This revision now requires changes to proceed.Sep 28 2019, 14:43

Probably going to break this into smaller parts.

Split into smaller parts. See D4201, D4202, D4206, D4207.