Page MenuHomePhabricator

wallet: Handle duplicate fileid exception
ClosedPublic

Authored by PiRK on Wed, Jan 13, 13:42.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC3fcc6ed32b9d: 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.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.