fix wallet restore: pass overwrite=true to allow restoring over existing wallet

This commit is contained in:
2026-03-22 11:08:05 -05:00
parent ff8368ca97
commit f5d26dd34d
5 changed files with 10 additions and 9 deletions

View File

@@ -760,7 +760,7 @@ bool RestoreSeedPage::validatePage() {
QString reply = "";
try {
char *resp = litelib_initialize_new_from_phrase(parent->dangerous, parent->server.toStdString().c_str(),
seed.toStdString().c_str(), birthday, number);
seed.toStdString().c_str(), birthday, number, true);
if (resp != nullptr) {
reply = litelib_process_response(resp);
@@ -779,7 +779,7 @@ if (reply.toUpper().trimmed() != "OK") {
qDebug() << __func__ << ": new server is " << parent->server;
char *resp = litelib_initialize_new_from_phrase(parent->dangerous, parent->server.toStdString().c_str(),
seed.toStdString().c_str(), birthday, number);
seed.toStdString().c_str(), birthday, number, true);
if (resp != nullptr) {
reply = litelib_process_response(resp);
} else {
@@ -805,7 +805,7 @@ if (reply.toUpper().trimmed() != "OK") {
// make a new connection to the new server
char* resp = litelib_initialize_new_from_phrase(parent->dangerous, parent->server.toStdString().c_str(),
seed.toStdString().c_str(), birthday, number);
seed.toStdString().c_str(), birthday, number, true);
reply = litelib_process_response(resp);
// retry with the new server

View File

@@ -217,7 +217,7 @@ MainWindow::MainWindow(QWidget *parent) :
QString reply = "";
try {
char* resp = litelib_initialize_new_from_phrase(config->dangerous, config->server.toStdString().c_str(),
seed.toStdString().c_str(), birthday, number);
seed.toStdString().c_str(), birthday, number, true);
reply = litelib_process_response(resp);
} catch (const std::exception& e) {
qDebug() << __func__ << ": caught an exception, ignoring: " << e.what();
@@ -229,7 +229,7 @@ MainWindow::MainWindow(QWidget *parent) :
qDebug() << __func__ << ": new server is " << config->server;
// retry with the new server
char* resp = litelib_initialize_new_from_phrase(config->dangerous,config->server.toStdString().c_str(),
seed.toStdString().c_str(), birthday, number);
seed.toStdString().c_str(), birthday, number, true);
reply = litelib_process_response(resp);
}
@@ -257,7 +257,7 @@ MainWindow::MainWindow(QWidget *parent) :
qDebug() << __func__ << ": new server is " << config->server;
// make a new connection to the new server
char* resp = litelib_initialize_new_from_phrase(config->dangerous,config->server.toStdString().c_str(),
seed.toStdString().c_str(), birthday, number);
seed.toStdString().c_str(), birthday, number, true);
reply = litelib_process_response(resp);
// retry with the new server