HomePhabricator

wallet: Move restorewallet() logic to the wallet section

Description

wallet: Move restorewallet() logic to the wallet section

Summary:

Currently restorewallet() logic is written in the RPC layer and it can“t be reused by GUI. So it moves this to the wallet section and then, GUI can access it.

This is necessary to implement the "Restore Wallet" menu item in the GUI (which is already implemented in bitcoin-core/gui#471 ).

This commit also simplifies error handling and adds a new behavior: if the restore fails, the invalid wallet folder is removed.

Backport of core#23721.

Includes the bugfixes from core#26005 and the required dependencies for this bugfix PR.
Backport of core#26005, core#25594 and core#25616.

Also include a bugfix from core#26747:
https://github.com/bitcoin/bitcoin/pull/26747/commits/8c7222bda3f7136f312a6e57b76d6a2d0a114f68
Note that the test has not been backported yet, so this is a partial backport of core#26747.

Note that we don't have the restore menu in the GUI yet.

Depends on D17952.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D17958

Details

Provenance
w0xlt <94266259+w0xlt@users.noreply.github.com>Authored on Dec 14 2021, 22:18
FabienCommitted on Apr 22 2025, 21:00
FabienPushed on Apr 22 2025, 21:00
Reviewer
Restricted Project
Differential Revision
D17958: wallet: Move restorewallet() logic to the wallet section
Parents
rABCd27e5156c299: [chronik-client] Add handling for WebSocket closure
Branches
Unknown
Tags
Unknown