Compare commits

9 Commits

Author SHA1 Message Date
288b54be6c restore rescan height dialog, use safe clear+resync approach 2026-03-22 11:23:48 -05:00
221231b53b fix rescan crash: use clear+resync instead of reinitializing lightclient 2026-03-22 11:16:50 -05:00
b7a04bebc1 fix rescan crash: shutdown old lightclient before overwriting 2026-03-22 11:12:19 -05:00
f5d26dd34d fix wallet restore: pass overwrite=true to allow restoring over existing wallet 2026-03-22 11:08:05 -05:00
ff8368ca97 fix birthday parse: treat empty input as 0, update hashes 2026-03-22 10:59:30 -05:00
7ec272df90 v1.1.1: release build with tx display fix, birthday parse fix 2026-03-22 10:52:25 -05:00
e2071653b9 Rebuild with memo filter fix for change detection
The previous fix checked memo.to_utf8().is_none() but empty memos
(all-zero bytes) have first byte 0x00 < 0xF5, so to_utf8() returns
Some(Ok("")) not None. Change outputs were never filtered.
Now checks for empty string as well as None.
2026-03-22 10:36:09 -05:00
90383b0f43 v1.1.1: Bump version, fix CFLAGS in lib/Makefile, rebuild binaries
- Bump APP_VERSION from 1.1.0 to 1.1.1
- Fix CFLAGS in lib/Makefile: remove quoted empty string that broke
  blake3 cross-compilation
- Rebuild Linux and Windows binaries with IVK change detection fix
- Update SHA-256 hashes in release notes
2026-03-22 10:02:51 -05:00
5fe5447474 v1.1.1: Fix sent tx showing wrong addresses, fix CRLF line endings in build.sh
- Fix change output detection using IVK-based decryption instead of
  static address list, so sent transactions only show the actual
  recipient address
- Fix CRLF line endings in build.sh
- Add release notes for v1.1.1
- Update Linux binary
2026-03-22 09:27:56 -05:00
9 changed files with 129 additions and 205 deletions

18
RELEASE_NOTES_v1.1.1.md Normal file
View File

@@ -0,0 +1,18 @@
# SilentDragonXLite v1.1.1 Release Notes
## What's New
### Transaction Display Fix
- **Fixed sent transactions showing wrong addresses** — Previously, sending to a single address would display multiple addresses in the transaction history (the recipient plus the wallet's own diversified change addresses). Change outputs are now correctly detected using Incoming Viewing Key (IVK) decryption instead of a static address list, so only the actual recipient address is shown.
### Wallet Birthday Fix
- **Fixed "Failed to parse wallet birthday" error** — Rescanning the wallet no longer fails due to trailing whitespace in the birthday height input.
---
## Downloads
| File | SHA-256 |
|---|---|
| `SilentDragonXLite` (Linux) | `ac44fbdfa343ffb550829827e3fbb95407e2ca3086d6bc34befdc7b5644763a7` |
| `SilentDragonXLite.exe` (Windows) | `093b6830f23b1f1d407c47f2df90a2c1465b2882a0c3b375237a5b731e36362c` |

Binary file not shown.

138
build.sh
View File

@@ -1,69 +1,69 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2019-2024 The Hush Developers # Copyright 2019-2024 The Hush Developers
# Released under the GPLv3 # Released under the GPLv3
UNAME=$(uname) UNAME=$(uname)
# check if rustc and cargo are installed, otherwise exit with error # check if rustc and cargo are installed, otherwise exit with error
if ! command -v rustc &> /dev/null if ! command -v rustc &> /dev/null
then then
echo "rustc could not be found. Please install it and try again." echo "rustc could not be found. Please install it and try again."
exit 1 exit 1
fi fi
if ! command -v cargo &> /dev/null if ! command -v cargo &> /dev/null
then then
echo "cargo could not be found. Please install it and try again." echo "cargo could not be found. Please install it and try again."
exit 1 exit 1
fi fi
if ! command -v qmake &> /dev/null if ! command -v qmake &> /dev/null
then then
echo "qmake could not be found. Please install QT and try again." echo "qmake could not be found. Please install QT and try again."
exit 1 exit 1
fi fi
if ! command -v make &> /dev/null if ! command -v make &> /dev/null
then then
echo "make could not be found. Please install it and try again." echo "make could not be found. Please install it and try again."
exit 1 exit 1
fi fi
VERSION=$(grep APP_VERSION src/version.h |cut -d\" -f2) VERSION=$(grep APP_VERSION src/version.h |cut -d\" -f2)
QTVERSION=$(qmake --version | tail -n 1 | cut -d' ' -f4) QTVERSION=$(qmake --version | tail -n 1 | cut -d' ' -f4)
QT_MAJOR_VERSION=$(echo $QTVERSION | cut -d. -f1) QT_MAJOR_VERSION=$(echo $QTVERSION | cut -d. -f1)
QT_SUB_VERSION=$(echo $QTVERSION | cut -d. -f2) QT_SUB_VERSION=$(echo $QTVERSION | cut -d. -f2)
if [ "$QT_MAJOR_VERSION" != "5" ]; then if [ "$QT_MAJOR_VERSION" != "5" ]; then
echo "Your QT version $QTVERSION is not compatible, only QT 5.x is supported" echo "Your QT version $QTVERSION is not compatible, only QT 5.x is supported"
exit 1 exit 1
fi fi
if [ "$QT_SUB_VERSION" -lt "12" ]; then if [ "$QT_SUB_VERSION" -lt "12" ]; then
echo "Your QT version $QTVERSION is not compatible, at least QT 5.12.0 is required" echo "Your QT version $QTVERSION is not compatible, at least QT 5.12.0 is required"
exit 1 exit 1
fi fi
echo "Compiling SilentDragonXLite $VERSION on $UNAME with QT $QTVERSION and args=$@" echo "Compiling SilentDragonXLite $VERSION on $UNAME with QT $QTVERSION and args=$@"
CONF=silentdragonx-lite.pro CONF=silentdragonx-lite.pro
set -e set -e
qbuild () { qbuild () {
qmake $CONF CONFIG+=debug qmake $CONF CONFIG+=release
#lupdate $CONF #lupdate $CONF
#lrelease $CONF #lrelease $CONF
# default to 2 jobs or use the -j value given as argument to this script # default to 2 jobs or use the -j value given as argument to this script
make -j2 "$@" make -j2 "$@"
} }
if [ "$1" == "clean" ]; then if [ "$1" == "clean" ]; then
make clean make clean
elif [ "$1" == "linguist" ]; then elif [ "$1" == "linguist" ]; then
lupdate $CONF lupdate $CONF
lrelease $CONF lrelease $CONF
elif [ "$1" == "cleanbuild" ]; then elif [ "$1" == "cleanbuild" ]; then
make clean make clean
qbuild "$@" qbuild "$@"
else else
qbuild "$@" qbuild "$@"
fi fi

View File

@@ -3,7 +3,7 @@ ifeq ($(shell uname),Darwin)
CFLAGS := "-mmacosx-version-min=10.11" CFLAGS := "-mmacosx-version-min=10.11"
else else
EXT := a EXT := a
CFLAGS := "" CFLAGS :=
endif endif
PWD := $(shell pwd) PWD := $(shell pwd)

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 (bool dangerous, const char* server);
extern char * litelib_initialize_new_from_phrase extern char * litelib_initialize_new_from_phrase
(bool dangerous, const char* server, const char* seed, (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_initialize_existing (bool dangerous,const char* server);
extern char * litelib_execute (const char* s, const char* args); extern char * litelib_execute (const char* s, const char* args);
extern void litelib_rust_free_string (char* s); extern void litelib_rust_free_string (char* s);

View File

@@ -140,6 +140,17 @@ pub extern "C" fn litelib_initialize_new_from_phrase(dangerous: bool, server: *c
//println!("Initializing with server: {}, seed: {}", server_str, seed_str); //println!("Initializing with server: {}, seed: {}", server_str, seed_str);
// Shut down the existing client if one is running, to stop background threads
if overwrite {
let old_lc = match LIGHTCLIENT.lock() {
Ok(l) => l.borrow().clone(),
Err(poisoned) => poisoned.into_inner().borrow().clone(),
};
if let Some(lc) = old_lc {
lc.shutdown();
}
}
let server = LightClientConfig::get_server_or_default(Some(server_str)); let server = LightClientConfig::get_server_or_default(Some(server_str));
let (config, _latest_block_height) = match LightClientConfig::create(server, dangerous) { let (config, _latest_block_height) = match LightClientConfig::create(server, dangerous) {
Ok((c, h)) => { Ok((c, h)) => {

View File

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

View File

@@ -160,143 +160,37 @@ MainWindow::MainWindow(QWidget *parent) :
// Rescan // Rescan
QObject::connect(ui->actionRescan, &QAction::triggered, [=]() { QObject::connect(ui->actionRescan, &QAction::triggered, [=]() {
DEBUG("rescan action triggered"); DEBUG("rescan action triggered");
Ui_Restore restoreSeed;
QDialog dialog(this);
restoreSeed.setupUi(&dialog);
Settings::saveRestore(&dialog);
rpc->fetchSeed([=](json reply) { // Ask user for rescan height
if (isJsonError(reply)) { bool ok;
QString heightStr = QInputDialog::getText(this, tr("Rescan Wallet"),
tr("Rescan from height (0 to rescan from the beginning):"),
QLineEdit::Normal, "0", &ok);
if (!ok) return;
QString height = heightStr.trimmed();
if (height.isEmpty()) height = "0";
// Validate it's a number
height.toULongLong(&ok);
if (!ok) {
QMessageBox::warning(this, tr("Invalid height"),
tr("Please enter a valid block height number."),
QMessageBox::Ok);
return; return;
} }
restoreSeed.seed->setReadOnly(true); // Clear wallet state from the specified height, then resync
restoreSeed.seed->setLineWrapMode(QPlainTextEdit::LineWrapMode::NoWrap); rpc->getConnection()->doRPCWithDefaultErrorHandling("clear", height, [=] (auto) {
QString seedJson = QString::fromStdString(reply["seed"].get<json::string_t>()); qDebug() << "Cleared wallet state to height" << height;
restoreSeed.seed->setPlainText(seedJson);
QString birthday = QString::number(reply["birthday"].get<json::number_unsigned_t>());
restoreSeed.birthday->setPlainText(birthday);
});
QObject::connect(restoreSeed.restore, &QPushButton::clicked, [&](){
QString seed = restoreSeed.seed->toPlainText();
if (seed.trimmed().split(" ").length() != 24) {
QMessageBox::warning(this, tr("Failed to restore wallet"),
tr("SilentDragonXLite needs 24 words to restore wallet"),
QMessageBox::Ok);
return false;
}
// 2. Validate birthday
QString birthday_str = restoreSeed.birthday->toPlainText();
bool ok;
qint64 birthday = birthday_str.toUInt(&ok);
if (!ok) {
QMessageBox::warning(this, tr("Failed to parse wallet birthday"),
tr("Couldn't understand wallet birthday. This should be a block height from where to rescan the wallet. You can leave it as '0' if you don't know what it should be."),
QMessageBox::Ok);
return false;
}
QString number_str = restoreSeed.quantity->text();
qint64 number = number_str.toUInt();
auto config = std::shared_ptr<ConnectionConfig>(new ConnectionConfig());
config->server = Settings::getInstance()->getSettings().server;
// 3. Attempt to restore wallet with the seed phrase
{
QString reply = "";
try {
char* resp = litelib_initialize_new_from_phrase(config->dangerous, config->server.toStdString().c_str(),
seed.toStdString().c_str(), birthday, number);
reply = litelib_process_response(resp);
} catch (const std::exception& e) {
qDebug() << __func__ << ": caught an exception, ignoring: " << e.what();
}
if (reply.toUpper().trimmed() != "OK") {
qDebug() << "Lite server " << config->server << " is down, getting a random one";
config->server = Settings::getRandomServer();
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);
reply = litelib_process_response(resp);
}
if (reply.toUpper().trimmed() != "OK") {
QMessageBox::warning(this, tr("Failed to restore wallet"),
tr("Couldn't restore the wallet") + "\n" + "server=" + config->server + "\n" + reply,
QMessageBox::Ok);
return false;
}
}
// 4. Finally attempt to save the wallet
{
QString reply = "";
try {
char* resp = litelib_execute("save", "");
QString reply = litelib_process_response(resp);
} catch (const std::exception& e) {
qDebug() << __func__ << ": caught an exception, ignoring: " << e.what();
}
if (reply.isEmpty()) {
qDebug() << "Lite server " << config->server << " is down, getting a random one";
config->server = Settings::getRandomServer();
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);
reply = litelib_process_response(resp);
// retry with the new server
try {
resp = litelib_execute("save", "");
reply = litelib_process_response(resp);
} catch (const std::exception& e) {
qDebug() << __func__ << ": caught an exception with new server, something is fucky: " << e.what();
}
}
QByteArray ba_reply = reply.toUtf8();
QJsonDocument jd_reply = QJsonDocument::fromJson(ba_reply);
QJsonObject parsed = jd_reply.object();
if (parsed.isEmpty() || parsed["result"].isNull()) {
QMessageBox::warning(this, tr("Failed to save wallet"),
tr("Couldn't save the wallet") + "\n" + "server=" + config->server + "\n" + reply,
QMessageBox::Ok);
} else {
qDebug() << __func__ << ": saved wallet correctly";
}
dialog.close();
// To rescan, we clear the wallet state, and then reload the connection
// This will start a sync, and show the scanning status.
this->getRPC()->clearWallet([=] (auto) {
qDebug() << "Clearing wallet...";
// Save the wallet
this->getRPC()->saveWallet([=] (auto) { this->getRPC()->saveWallet([=] (auto) {
qDebug() << "Saving wallet..."; qDebug() << "Saved cleared wallet, reloading connection to start rescan...";
// Then reload the connection. The ConnectionLoader deletes itself. auto cl = new ConnectionLoader(this, rpc);
auto cl = new ConnectionLoader(this, rpc); cl->loadConnection();
cl->loadConnection();
}); });
}); });
}); // actionRescan
}
});
dialog.exec();
}); // actionReason
// Import Privkey // Import Privkey
QObject::connect(ui->actionImport_Privatkey, &QAction::triggered, this, &MainWindow::importPrivKey); QObject::connect(ui->actionImport_Privatkey, &QAction::triggered, this, &MainWindow::importPrivKey);

View File

@@ -1 +1 @@
#define APP_VERSION "1.1.0" #define APP_VERSION "1.1.1"