MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / restore

Method restore

src/qt/walletcontroller.cpp:400–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400void RestoreWalletActivity::restore(const fs::path& backup_file, const std::string& wallet_name)
401{
402 QString name = QString::fromStdString(wallet_name);
403
404 showProgressDialog(
405 //: Title of progress window which is displayed when wallets are being restored.
406 tr("Restore Wallet"),
407 /*: Descriptive text of the restore wallets progress window which indicates to
408 the user that wallets are currently being restored.*/
409 tr("Restoring Wallet <b>%1</b>…").arg(name.toHtmlEscaped()));
410
411 QTimer::singleShot(0, worker(), [this, backup_file, wallet_name] {
412 auto wallet{node().walletLoader().restoreWallet(backup_file, wallet_name, m_warning_message, /*load_after_restore=*/true)};
413
414 if (wallet) {
415 m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(*wallet));
416 } else {
417 m_error_message = util::ErrorString(wallet);
418 }
419
420 QTimer::singleShot(0, this, &RestoreWalletActivity::finish);
421 });
422}
423
424void RestoreWalletActivity::finish()
425{

Callers 2

createActionsMethod · 0.45
paintFunction · 0.45

Calls 3

ErrorStringFunction · 0.85
restoreWalletMethod · 0.80
getOrCreateWalletMethod · 0.80

Tested by

no test coverage detected