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

@@ -14,5 +14,5 @@
| File | SHA-256 |
|---|---|
| `SilentDragonXLite` (Linux) | `dcf06258be02d77bd3bcfa34414f68d99f619d88668029e7c84697159fbe5010` |
| `SilentDragonXLite.exe` (Windows) | `5faba5338cc88d05883e8b1b0ce8486db3f08607a6cd57826b361c2863e36617` |
| `SilentDragonXLite` (Linux) | `17b34e63bce97dcb53eb930b6766aca88c7388303cc34db57d11db96afae5f48` |
| `SilentDragonXLite.exe` (Windows) | `ce2df9860927a07459ef50231e4c133a07a96891b668e90187849492f96ec125` |

Binary file not shown.

View File

@@ -9,7 +9,8 @@ extern bool litelib_wallet_exists (const char* chain_name);
extern char * litelib_initialize_new (bool dangerous, const char* server);
extern char * litelib_initialize_new_from_phrase
(bool dangerous, const char* server, const char* seed,
unsigned long long birthday, unsigned long long number);
unsigned long long birthday, unsigned long long number,
bool overwrite);
extern char * litelib_initialize_existing (bool dangerous,const char* server);
extern char * litelib_execute (const char* s, const char* args);
extern void litelib_rust_free_string (char* s);

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