Enable the GUI to also use the load_on_startup feature.
Wallets loaded in the GUI always have load_on_startup=true.
When they are unloaded from the GUI, load_on_startup=false.To facilitate this change, UpdateWalletSetting is moved into the wallet
module and called from within LoadWallet, RemoveWallet, and
Createwallet. This change does not actually touch the GUI code but
rather the wallet functions that are shared between the GUI and RPC.
This is a backport of core#19754
Depends on D10185
Note: std::optional works a bit differently than core's Optional, so I had to account for a couple of changes in wallet.cpp::UpdateWalletSetting.
See :
- https://github.com/bitcoin/bitcoin/pull/21415/commits/ebc4ab721b0371c0ef217c0f5bd7d42613e951e6: use .value() instead of .get()
- https://github.com/fanquake/bitcoin/commit/fa4435e22f78f632a455016ce00a357009aac059#diff-1f2db0e4d5c12d109c7f0962333c245b49b696cb39ff432da048e9d6c08944d8: don't check for equality with std::nullopt