HomePhabricator

wallet: Handle duplicate fileid exception

Description

wallet: Handle duplicate fileid exception

Summary:
Loading two identical wallet files caused a crash

Handle the duplicate fileid exception thrown at CheckUniqueFileid in tow cases:

  • when duplicate wallets are set on the command line - catch in LoadWallets;
  • when a duplicate wallet is loaded dynamically - catch in LoadWallet.

This is a backport of Core PR16923

Test Plan:
ninja all check-all

In bitcoin-qt, backup the currently open wallet to a file named wallet.dat,
then in the console window type loadwallet /path/to/wallet/.
Check that the program does not crash and you get a useful error message dialog.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
João Barbosa <joao.paulo.barbosa@gmail.com>Authored on Wed, Jan 13, 15:21
PiRKCommitted on Wed, Jan 13, 15:27
abc-botPushed on Wed, Jan 13, 15:27
Reviewer
Restricted Project
Differential Revision
D8898: wallet: Handle duplicate fileid exception
Parents
rABCfdcd3a04fbf1: [Cashtab] Prepare for migration to psf bch-api with new utxo key
Branches
Unknown
Tags
Unknown