Skip to content

Commit

Permalink
Merge bitcoin#13506: Qt: load wallet in UI after possible init aborts
Browse files Browse the repository at this point in the history
3a03d2a Qt: load wallet in UI after possible init aborts (Jonas Schnelli)

Pull request description:

  Bug was introduced in bitcoin#13063 (80b4910) where bitcoin#13097 made possible to get "hit" by that bug. Reported by @ken2812221 (bitcoin#13097 (comment)).

  Dynamically loading a wallet informs the UI (and therefore makes the instance accessible) about the new wallet before all possible error cases where handled.

  Easy to reproduce by starting `bitcoin-qt --regtest --nowallet -usehd=0` then in the console enter `loadwallet wallet.dat`.

  This PR will make sure only correctly initialised (loaded) wallets will appear in the UI.

Tree-SHA512: 3139545e852d53b117182b579f45259c198d1c25c1a6fa4e0108f942d45f6fe2691e6bfcbbae2e18c33ad0174a520f379c17867b1eb87f950d830a5f519fec4f
  • Loading branch information
MarcoFalke authored and PastaPastaPasta committed Dec 16, 2020
1 parent 06d3d77 commit 5d48310
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5323,6 +5323,8 @@ CWallet* CWallet::CreateWalletFromFile(const std::string& name, const fs::path&
}
}

uiInterface.LoadWallet(walletInstance);

// Register with the validation interface. It's ok to do this after rescan since we're still holding cs_main.
RegisterValidationInterface(temp_wallet.release());

Expand Down

0 comments on commit 5d48310

Please sign in to comment.