mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
Remove use of uiInterface.LoadWallet in wallet code
This also changes the uiInterface.LoadWallet signal argument type from shared_ptr<CWallet> to unique_ptr<interfaces::Wallet> because CWallet is an internal wallet class that shouldn't be used in non-wallet code (and also can't be passed across process boundaries). This commit does not change behavior.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <consensus/validation.h>
|
||||
#include <fs.h>
|
||||
#include <interfaces/chain.h>
|
||||
#include <interfaces/wallet.h>
|
||||
#include <key.h>
|
||||
#include <key_io.h>
|
||||
#include <keystore.h>
|
||||
@@ -4391,7 +4392,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
|
||||
}
|
||||
}
|
||||
|
||||
uiInterface.LoadWallet(walletInstance);
|
||||
chain.loadWallet(interfaces::MakeWallet(walletInstance));
|
||||
|
||||
// Register with the validation interface. It's ok to do this after rescan since we're still holding cs_main.
|
||||
RegisterValidationInterface(walletInstance.get());
|
||||
|
||||
Reference in New Issue
Block a user