diff --git a/README.md b/README.md index 1848931..4f21aec 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,14 @@ This means your IP address is known to these servers. Enable Tor setting in Sile Go to the releases page and grab the latest installers or binary. https://github.com/MyHush/SilentDragonLite/releases +### Note Management +SilentDragonLite does automatic note and utxo management, which means it doesn't allow you to manually select which address to send outgoing transactions from. It follows these principles: +* Defaults to sending shielded transactions, even if you're sending to a transparent address +* Sapling funds need at least 2 confirmations before they can be spent +* Can select funds from multiple shielded addresses in the same transaction +* Will automatically shield your transparent funds at the first opportunity +* When sending an outgoing transaction to a shielded address, SilentDragonLite can decide to use the transaction to additionally shield your transparent funds (i.e., send your transparent funds to your own shielded address in the same transaction) + ## Compiling from source * SilentDragonLite is written in C++ 14, and can be compiled with g++/clang++/visual c++. * It also depends on Qt5, which you can get from [here](https://www.qt.io/download). diff --git a/lib/Cargo.lock b/lib/Cargo.lock index 7b6162e..432c1c0 100644 --- a/lib/Cargo.lock +++ b/lib/Cargo.lock @@ -1051,7 +1051,7 @@ version = "0.1.0" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=099ad194dac6ee51474b3637d357aca0665a8181)", + "silentdragonlitelib 0.1.0 (git+https://github.com/DenioD/silentdragonlite-cli?rev=df119fdfff128baca006647851fcc6a2a14b7f92)", ] [[package]] @@ -1467,7 +1467,7 @@ dependencies = [ [[package]] name = "silentdragonlitelib" version = "0.1.0" -source = "git+https://github.com/MyHush/silentdragonlite-cli?rev=099ad194dac6ee51474b3637d357aca0665a8181#099ad194dac6ee51474b3637d357aca0665a8181" +source = "git+https://github.com/DenioD/silentdragonlite-cli?rev=df119fdfff128baca006647851fcc6a2a14b7f92#df119fdfff128baca006647851fcc6a2a14b7f92" dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bellman 0.1.0 (git+https://github.com/DenioD/librustzcash.git?rev=caaee693c47c2ee9ecd1e1546b8fe3c714f342bc)", @@ -2481,7 +2481,7 @@ dependencies = [ "checksum serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2" "checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" "checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" -"checksum silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=099ad194dac6ee51474b3637d357aca0665a8181)" = "" +"checksum silentdragonlitelib 0.1.0 (git+https://github.com/DenioD/silentdragonlite-cli?rev=df119fdfff128baca006647851fcc6a2a14b7f92)" = "" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" "checksum sodiumoxide 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585232e78a4fc18133eef9946d3080befdf68b906c51b621531c37e91787fa2b" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 2681097..94aaca5 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -11,4 +11,4 @@ crate-type = ["staticlib"] [dependencies] libc = "0.2.58" lazy_static = "1.4.0" -silentdragonlitelib = { git = "https://github.com/MyHush/silentdragonlite-cli", rev = "099ad194dac6ee51474b3637d357aca0665a8181" } +silentdragonlitelib = { git = "https://github.com/DenioD/silentdragonlite-cli", rev = "df119fdfff128baca006647851fcc6a2a14b7f92" } diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 932ded9..8be7c55 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -57,6 +57,9 @@ pub extern fn litelib_initialize_new(dangerous: bool, server: *const c_char) -> } }; + // Initialize logging + let _ = lightclient.init_logging(); + let seed = match lightclient.do_seed_phrase() { Ok(s) => s.dump(), Err(e) => { @@ -105,6 +108,9 @@ pub extern fn litelib_initialize_new_from_phrase(dangerous: bool, server: *const } }; + // Initialize logging + let _ = lightclient.init_logging(); + LIGHTCLIENT.lock().unwrap().replace(Some(Arc::new(lightclient))); let c_str = CString::new("OK").unwrap(); @@ -137,6 +143,9 @@ pub extern fn litelib_initialize_existing(dangerous: bool, server: *const c_char } }; + // Initialize logging + let _ = lightclient.init_logging(); + LIGHTCLIENT.lock().unwrap().replace(Some(Arc::new(lightclient))); let c_str = CString::new("OK").unwrap(); diff --git a/res/Info.plist b/res/Info.plist index fbd864e..aecc2d7 100644 --- a/res/Info.plist +++ b/res/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile logo.icns CFBundleIdentifier - com.yourcompany.silentdragon + com.yourcompany.SilentDragonLite CFBundlePackageType APPL CFBundleSignature @@ -39,4 +39,4 @@ NSUIElement - \ No newline at end of file + diff --git a/src/about.ui b/src/about.ui index 88873e6..815abf0 100644 --- a/src/about.ui +++ b/src/about.ui @@ -17,7 +17,7 @@ - SilentDragon Lite + SilentDragonLite diff --git a/src/connection.cpp b/src/connection.cpp index 7e90358..9b0f214 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -42,14 +42,14 @@ void ConnectionLoader::doAutoConnect() { qDebug() << "Doing autoconnect"; auto config = std::shared_ptr(new ConnectionConfig()); - config->dangerous = true; + config->dangerous = false; config->server = Settings::getInstance()->getSettings().server; // Initialize the library main->logger->write(QObject::tr("Attempting to initialize library with ") + config->server); // Check to see if there's an existing wallet - if (litelib_wallet_exists(Settings::getChainName().toStdString().c_str())) { + if (litelib_wallet_exists(Settings::getDefaultChainName().toStdString().c_str())) { main->logger->write(QObject::tr("Using existing wallet.")); char* resp = litelib_initialize_existing(config->dangerous, config->server.toStdString().c_str()); QString response = litelib_process_response(resp); @@ -68,9 +68,10 @@ void ConnectionLoader::doAutoConnect() { auto me = this; // After the lib is initialized, try to do get info - connection->doRPC("info", "", [=](auto) { + connection->doRPC("info", "", [=](auto reply) { // If success, set the connection main->logger->write("Connection is online."); + connection->setInfo(reply); isSyncing = new QAtomicInteger(); isSyncing->store(true); @@ -138,7 +139,6 @@ Connection* ConnectionLoader::makeConnection(std::shared_ptr c // Update the UI with the status void ConnectionLoader::showInformation(QString info, QString detail) { - qDebug() << "Showing info " << info << ":" << detail; connD->status->setText(info); connD->statusDetail->setText(detail); diff --git a/src/connection.h b/src/connection.h index 043a858..5ed3a09 100644 --- a/src/connection.h +++ b/src/connection.h @@ -123,8 +123,12 @@ public: void showTxError(const QString& error); + json getInfo() { return serverInfo; } + void setInfo(const json& info) { serverInfo = info; } + private: - bool shutdownInProgress = false; + bool shutdownInProgress = false; + json serverInfo; }; #endif diff --git a/src/connection.ui b/src/connection.ui index 66b5143..c421f68 100644 --- a/src/connection.ui +++ b/src/connection.ui @@ -14,7 +14,7 @@ - silentdragon + SilentDragonLite true diff --git a/src/controller.cpp b/src/controller.cpp index dea37d7..2b6cd4d 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -135,34 +135,44 @@ void Controller::refresh(bool force) { getInfoThenRefresh(force); } +void Controller::processInfo(const json& info) { + // Testnet? + QString chainName; + if (!info["chain_name"].is_null()) { + chainName = QString::fromStdString(info["chain_name"].get()); + Settings::getInstance()->setTestnet(chainName == "test"); + }; + + + QString version = QString::fromStdString(info["version"].get()); + Settings::getInstance()->sethushdVersion(version); + + // Recurring pamynets are testnet only + if (!Settings::getInstance()->isTestnet()) + main->disableRecurring(); +} + void Controller::getInfoThenRefresh(bool force) { if (!zrpc->haveConnection()) return noConnection(); static bool prevCallSucceeded = false; - zrpc->fetchInfo([=] (const json& reply) { - prevCallSucceeded = true; + zrpc->fetchLatestBlock([=] (const json& reply) { + prevCallSucceeded = true; - // Testnet? - QString chainName; - if (!reply["chain_name"].is_null()) { - chainName = QString::fromStdString(reply["chain_name"].get()); - Settings::getInstance()->setTestnet(chainName == "test"); - }; - - // Recurring pamynets are testnet only - if (!Settings::getInstance()->isTestnet()) - main->disableRecurring(); - - int curBlock = reply["latest_block_height"].get(); + int curBlock = reply["height"].get(); bool doUpdate = force || (model->getLatestBlock() != curBlock); model->setLatestBlock(curBlock); ui->blockHeight->setText(QString::number(curBlock)); + main->logger->write(QString("Refresh. curblock ") % QString::number(curBlock) % ", update=" % (doUpdate ? "true" : "false") ); + // Connected, so display checkmark. - auto tooltip = Settings::getInstance()->getSettings().server + "\n" + QString::fromStdString(reply.dump()); + auto tooltip = Settings::getInstance()->getSettings().server + "\n" + + QString::fromStdString(zrpc->getConnection()->getInfo().dump()); QIcon i(":/icons/res/connected.gif"); + QString chainName = Settings::getInstance()->isTestnet() ? "test" : "main"; main->statusLabel->setText(chainName + "(" + QString::number(curBlock) + ")"); // use currency ComboBox as input @@ -196,13 +206,6 @@ void Controller::getInfoThenRefresh(bool force) { main->statusLabel->setToolTip(tooltip); main->statusIcon->setPixmap(i.pixmap(16, 16)); main->statusIcon->setToolTip(tooltip); - - //int version = reply["version"].get(); - int version = 1; - Settings::getInstance()->sethushdVersion(version); - ui->Version->setText(QString::fromStdString(reply["version"].get())); - ui->Vendor->setText(QString::fromStdString(reply["vendor"].get())); - // See if recurring payments needs anything Recurring::getInstance()->processPending(main); diff --git a/src/controller.h b/src/controller.h index 30208de..7866c90 100644 --- a/src/controller.h +++ b/src/controller.h @@ -72,6 +72,8 @@ public: void saveWallet(const std::function& cb) { zrpc->saveWallet(cb); } + void clearWallet(const std::function& cb) { zrpc->clearWallet(cb); } + void createNewZaddr(bool sapling, const std::function& cb) { unlockIfEncrypted([=] () { zrpc->createNewZaddr(sapling, cb); @@ -117,6 +119,7 @@ public: QString getDefaultTAddress(); private: + void processInfo(const json&); void refreshBalances(); void refreshTransactions(); diff --git a/src/liteinterface.cpp b/src/liteinterface.cpp index 82f2dd1..57eaeb1 100644 --- a/src/liteinterface.cpp +++ b/src/liteinterface.cpp @@ -84,6 +84,13 @@ void LiteInterface::saveWallet(const std::function& cb) { conn->doRPCWithDefaultErrorHandling("save", "", cb); } +void LiteInterface::clearWallet(const std::function& cb) { + if (conn == nullptr) + return; + + conn->doRPCWithDefaultErrorHandling("clear", "", cb); +} + void LiteInterface::unlockWallet(QString password, const std::function& cb) { if (conn == nullptr) return; @@ -130,6 +137,15 @@ void LiteInterface::fetchInfo(const std::function& cb, conn->doRPC("info", "", cb, err); } + +void LiteInterface::fetchLatestBlock(const std::function& cb, + const std::function& err) { + if (conn == nullptr) + return; + + conn->doRPC("height", "", cb, err); +} + /** * Method to get all the private keys for both z and t addresses. It will make 2 batch calls, * combine the result, and call the callback with a single list containing both the t-addr and z-addr diff --git a/src/liteinterface.h b/src/liteinterface.h index 33c3446..43c5e6c 100644 --- a/src/liteinterface.h +++ b/src/liteinterface.h @@ -44,6 +44,9 @@ public: void fetchInfo(const std::function& cb, const std::function& err); + + void fetchLatestBlock(const std::function& cb, + const std::function& err); void fetchBalance(const std::function& cb); @@ -56,6 +59,7 @@ public: void fetchSeed(const std::function&); void saveWallet(const std::function& cb); + void clearWallet(const std::function& cb); void fetchWalletEncryptionStatus(const std::function& cb); void encryptWallet(QString password, const std::function& cb); diff --git a/src/main.cpp b/src/main.cpp index 8d85d26..3d915d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -205,7 +205,7 @@ public: w = new MainWindow(); - w->setWindowTitle("SilentDragon Lite v" + QString(APP_VERSION)); + w->setWindowTitle("SilentDragonLite v" + QString(APP_VERSION)); // If there was a payment URI on the command line, pay it if (parser.positionalArguments().length() > 0) { diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2056b8e..de7cfeb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -16,6 +16,7 @@ #include "connection.h" #include "requestdialog.h" #include "websockets.h" +#include using json = nlohmann::json; @@ -108,6 +109,20 @@ MainWindow::MainWindow(QWidget *parent) : AppDataServer::getInstance()->connectAppDialog(this); }); + // Rescan + QObject::connect(ui->actionRescan, &QAction::triggered, [=]() { + // To rescan, we clear the wallet state, and then reload the connection + // This will start a sync, and show the scanning status. + getRPC()->clearWallet([=] (auto) { + // Save the wallet + getRPC()->saveWallet([=] (auto) { + // Then reload the connection. The ConnectionLoader deletes itself. + auto cl = new ConnectionLoader(this, rpc); + cl->loadConnection(); + }); + }); + }); + // Address Book QObject::connect(ui->action_Address_Book, &QAction::triggered, this, &MainWindow::addressBook); @@ -438,19 +453,17 @@ void MainWindow::setupSettingsModal() { // Fetch prices settings.chkFetchPrices->setChecked(Settings::getInstance()->getAllowFetchPrices()); + // List of default servers + settings.cmbServer->addItem("https://hush-lightwallet.de:443"); + settings.cmbServer->addItem("https://hush-lightwallet.de:443"); + // Load current values into the dialog auto conf = Settings::getInstance()->getSettings(); - settings.txtServer->setText(conf.server); + settings.cmbServer->setCurrentText(conf.server); // Connection tab by default settings.tabWidget->setCurrentIndex(0); - // Enable the troubleshooting options only if using embedded hushd - if (!rpc->isEmbedded()) { - settings.chkRescan->setEnabled(false); - settings.chkRescan->setToolTip(tr("You're using an external hushd. Please restart hushd with -rescan")); - } - if (settingsDialog.exec() == QDialog::Accepted) { // Check for updates Settings::getInstance()->setCheckForUpdates(settings.chkCheckUpdates->isChecked()); @@ -459,14 +472,22 @@ void MainWindow::setupSettingsModal() { Settings::getInstance()->setAllowFetchPrices(settings.chkFetchPrices->isChecked()); // Save the server - Settings::getInstance()->saveSettings(settings.txtServer->text().trimmed()); + bool reloadConnection = false; + if (conf.server != settings.cmbServer->currentText().trimmed()) { + reloadConnection = true; + } + Settings::getInstance()->saveSettings(settings.cmbServer->currentText().trimmed()); - if (false /* connection needs reloading?*/) { + if (reloadConnection) { // Save settings - Settings::getInstance()->saveSettings(settings.txtServer->text()); - - auto cl = new ConnectionLoader(this, rpc); - cl->loadConnection(); + Settings::getInstance()->saveSettings(settings.cmbServer->currentText()); + + // Save the wallet + getRPC()->saveWallet([=] (auto) { + // Then reload the connection. The ConnectionLoader deletes itself. + auto cl = new ConnectionLoader(this, rpc); + cl->loadConnection(); + }); } } }); @@ -474,7 +495,7 @@ void MainWindow::setupSettingsModal() { void MainWindow::addressBook() { // Check to see if there is a target. - QRegExp re("Address[0-9]+", Qt::CaseInsensitive); + QRegularExpression re("Address[0-9]+", QRegularExpression::CaseInsensitiveOption); for (auto target: ui->sendToWidgets->findChildren(re)) { if (target->hasFocus()) { AddressBook::open(this, target); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 3e3b52d..aa06242 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -11,7 +11,7 @@ - silentdragon + SilentDragonLite @@ -399,8 +399,8 @@ 0 0 - 1226 - 504 + 1162 + 344 @@ -1095,7 +1095,7 @@ 0 0 1274 - 22 + 39 @@ -1139,6 +1139,8 @@ + + @@ -1245,6 +1247,11 @@ Remove Wallet Encryption + + + Rescan + + diff --git a/src/scripts/dounifiedbuild.ps1 b/src/scripts/dounifiedbuild.ps1 index d9b1a16..6d78db3 100644 --- a/src/scripts/dounifiedbuild.ps1 +++ b/src/scripts/dounifiedbuild.ps1 @@ -2,16 +2,17 @@ param ( [Parameter(Mandatory=$true)][string]$version, [Parameter(Mandatory=$true)][string]$prev, + [Parameter(Mandatory=$true)][string]$certificate, [Parameter(Mandatory=$true)][string]$server, [Parameter(Mandatory=$true)][string]$winserver ) Write-Host "[Initializing]" -Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-binaries-silentdragon-v$version.tar.gz -Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-deb-silentdragon-v$version.deb -Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-binaries-silentdragon-v$version.zip -Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-installer-silentdragon-v$version.msi -Remove-Item -Force -ErrorAction Ignore ./artifacts/macOS-silentdragon-v$version.dmg +Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-binaries-SilentDragonLite-v$version.tar.gz +Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-deb-SilentDragonLite-v$version.deb +Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-binaries-SilentDragonLite-v$version.zip +Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-installer-SilentDragonLite-v$version.msi +Remove-Item -Force -ErrorAction Ignore ./artifacts/macOS-SilentDragonLite-v$version.dmg Remove-Item -Force -ErrorAction Ignore ./artifacts/signatures-v$version.tar.gz @@ -27,7 +28,7 @@ Write-Host "" Write-Host "[Building on Mac]" -bash src/scripts/mkmacdmg.sh --qt_path ~/Qt/5.11.1/clang_64/ --version $version --hush_path ~/prod/hush +bash src/scripts/mkmacdmg.sh --qt_path ~/Qt/5.11.1/clang_64/ --version $version --certificate "$certificate" if (! $?) { Write-Output "[Error]" exit 1; @@ -37,9 +38,11 @@ Write-Host "" Write-Host "[Building Linux + Windows]" Write-Host -NoNewline "Copying files.........." +# Cleanup some local files to aid copying +rm -rf lib/target/ ssh $server "rm -rf /tmp/zqwbuild" ssh $server "mkdir /tmp/zqwbuild" -scp -r src/ singleapplication/ res/ ./silentdragonlite.pro ./application.qrc ./LICENSE ./README.md ${server}:/tmp/zqwbuild/ | Out-Null +scp -r src/ singleapplication/ res/ ./silentdragon-lite.pro ./application.qrc ./LICENSE ./README.md ${server}:/tmp/zqwbuild/ | Out-Null ssh $server "dos2unix -q /tmp/zqwbuild/src/scripts/mkrelease.sh" | Out-Null ssh $server "dos2unix -q /tmp/zqwbuild/src/version.h" Write-Host "[OK]" @@ -86,11 +89,11 @@ Write-Host "[OK]" # Finally, test to make sure all files exist Write-Host -NoNewline "Checking Build........." -if (! (Test-Path ./artifacts/linux-binaries-silentdragon-v$version.tar.gz) -or - ! (Test-Path ./artifacts/linux-deb-silentdragon-v$version.deb) -or - ! (Test-Path ./artifacts/Windows-binaries-silentdragon-v$version.zip) -or - ! (Test-Path ./artifacts/macOS-silentdragon-v$version.dmg) -or - ! (Test-Path ./artifacts/Windows-installer-silentdragon-v$version.msi) ) { +if (! (Test-Path ./artifacts/linux-binaries-SilentDragonLite-v$version.tar.gz) -or + ! (Test-Path ./artifacts/linux-deb-SilentDragonLite-v$version.deb) -or + ! (Test-Path ./artifacts/Windows-binaries-SilentDragonLite-v$version.zip) -or + ! (Test-Path ./artifacts/macOS-SilentDragonLite-v$version.dmg) -or + ! (Test-Path ./artifacts/Windows-installer-SilentDragonLite-v$version.msi) ) { Write-Host "[Error]" exit 1; } diff --git a/src/scripts/mkmacdmg.sh b/src/scripts/mkmacdmg.sh index a9d8799..a223eeb 100755 --- a/src/scripts/mkmacdmg.sh +++ b/src/scripts/mkmacdmg.sh @@ -12,8 +12,8 @@ case $key in shift # past argument shift # past value ;; - -z|--hush_path) - hush_DIR="$2" + -c|--certificate) + CERTIFICATE="$2" shift # past argument shift # past value ;; @@ -35,6 +35,11 @@ if [ -z $QT_PATH ]; then exit 1; fi +if [ -z $CERTIFICATE ]; then + echo "CERTIFICATE is not set. Please set it the name of the MacOS developer certificate to sign the binary with"; + exit 1; +fi + if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set. Please set it to the current release version of the app"; exit 1; @@ -70,7 +75,8 @@ echo -n "Deploying.............." mkdir artifacts >/dev/null 2>&1 rm -f artifcats/Silentdragonlite.dmg >/dev/null 2>&1 rm -f artifacts/rw* >/dev/null 2>&1 -$QT_PATH/bin/macdeployqt Silentdragonlite.app +$QT_PATH/bin/macdeployqt SilentDragonLite.app +codesign --deep --force --verify --verbose -s "$CERTIFICATE" --options runtime --timestamp SilentDragonLite.app/ echo "[OK]" diff --git a/src/scripts/mkwininstaller.ps1 b/src/scripts/mkwininstaller.ps1 index 1ca536a..fa4ef45 100644 --- a/src/scripts/mkwininstaller.ps1 +++ b/src/scripts/mkwininstaller.ps1 @@ -2,16 +2,13 @@ param ( [Parameter(Mandatory=$true)][string]$version ) -$target="silentdragon-v$version" +$target="SilentDragonLite-v$version" Remove-Item -Path release/wininstaller -Recurse -ErrorAction Ignore | Out-Null New-Item release/wininstaller -itemtype directory | Out-Null -Copy-Item release/$target/silentdragon.exe release/wininstaller/ -Copy-Item release/$target/LICENSE release/wininstaller/ -Copy-Item release/$target/README.md release/wininstaller/ -Copy-Item release/$target/hushd.exe release/wininstaller/ -Copy-Item release/$target/hush-cli.exe release/wininstaller/ +Copy-Item release/$target/SilentDragonLite.exe release/wininstaller/ +Copy-Item release/$target/LICENSE release/wininstaller/ Get-Content src/scripts/silentdragonlite.wxs | ForEach-Object { $_ -replace "RELEASE_VERSION", "$version" } | Out-File -Encoding utf8 release/wininstaller/silentdragonlite.wxs @@ -20,10 +17,10 @@ if (!$?) { exit 1; } -light.exe -ext WixUIExtension -cultures:en-us release/wininstaller/silentdragonlite.wixobj -out release/wininstaller/silentdragon.msi +light.exe -ext WixUIExtension -cultures:en-us release/wininstaller/SilentDragonLite.wixobj -out release/wininstaller/SilentDragonLite.msi if (!$?) { exit 1; } New-Item artifacts -itemtype directory -Force | Out-Null -Copy-Item release/wininstaller/silentdragon.msi ./artifacts/Windows-installer-$target.msi \ No newline at end of file +Copy-Item release/wininstaller/SilentDragonLite.msi ./artifacts/Windows-installer-$target.msi diff --git a/src/scripts/signbinaries.sh b/src/scripts/signbinaries.sh index 341b735..9314f15 100755 --- a/src/scripts/signbinaries.sh +++ b/src/scripts/signbinaries.sh @@ -35,7 +35,7 @@ rm -f signatures-v$APP_VERSION.tar.gz # sha256sum the binaries gsha256sum *$APP_VERSION* > sha256sum-v$APP_VERSION.txt -for i in $( ls *silentdragon-v$APP_VERSION* sha256sum-v$APP_VERSION* ); do +for i in $( ls *SilentDragonLite-v$APP_VERSION* sha256sum-v$APP_VERSION* ); do echo "Signing" $i gpg --batch --output ../release/signatures/$i.sig --detach-sig $i done diff --git a/src/scripts/zec-qt-wallet.wxs b/src/scripts/zec-qt-wallet.wxs index 7879944..7f5dc4b 100644 --- a/src/scripts/zec-qt-wallet.wxs +++ b/src/scripts/zec-qt-wallet.wxs @@ -1,13 +1,13 @@ - + - - + + @@ -55,24 +55,21 @@ - + + Name="SilentDragonLite" WorkingDirectory="INSTALLFOLDER" Icon="SilentDragonLite.exe" > - - - - + - + diff --git a/src/sendtab.cpp b/src/sendtab.cpp index 0f6e646..b014776 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -214,7 +214,7 @@ void MainWindow::updateLabelsAutoComplete() { labelCompleter->setCaseSensitivity(Qt::CaseInsensitive); // Then, find all the address fields and update the completer. - QRegExp re("Address[0-9]+", Qt::CaseInsensitive); + QRegularExpression re("Address[0-9]+", QRegularExpression::CaseInsensitiveOption); for (auto target: ui->sendToWidgets->findChildren(re)) { target->setCompleter(labelCompleter); } diff --git a/src/settings.cpp b/src/settings.cpp index 279693e..ba8207b 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -74,11 +74,11 @@ bool Settings::isTAddress(QString addr) { return addr.startsWith("R"); } -int Settings::gethushdVersion() { +QString Settings::gethushdVersion() { return _hushdVersion; } -void Settings::sethushdVersion(int version) { +void Settings::sethushdVersion(QString version) { _hushdVersion = version; } diff --git a/src/settings.h b/src/settings.h index a385ce4..25ef294 100644 --- a/src/settings.h +++ b/src/settings.h @@ -42,8 +42,8 @@ public: bool isSyncing(); void setSyncing(bool syncing); - int gethushdVersion(); - void sethushdVersion(int version); + QString gethushdVersion(); + void sethushdVersion(QString version); void setUseEmbedded(bool r) { _useEmbedded = r; } bool useEmbedded() { return _useEmbedded; } @@ -119,13 +119,12 @@ public: static bool isValidAddress(QString addr); - static QString getChainName() { return QString("main"); } + static QString getDefaultChainName() { return QString("main"); } static const QString labelRegExp; - static const int updateSpeed = 20 * 1000; // 20 sec - static const int quickUpdateSpeed = 5 * 1000; // 5 sec - static const int priceRefreshSpeed = 5 * 60 * 1000; // 5 mins + static const int updateSpeed = 30 * 1000; // 30 sec + static const int priceRefreshSpeed = 5 * 60 * 1000; // 1 hr private: // This class can only be accessed through Settings::getInstance() @@ -138,7 +137,7 @@ private: bool _isTestnet = false; bool _isSyncing = false; int _blockNumber = 0; - int _hushdVersion = 0; + QString _hushdVersion = 0; bool _useEmbedded = false; bool _headless = false; diff --git a/src/settings.ui b/src/settings.ui index 65c3dd3..5f2bf52 100644 --- a/src/settings.ui +++ b/src/settings.ui @@ -6,16 +6,10 @@ 0 0 - 540 + 733 539 - - - 540 - 500 - - Settings @@ -52,19 +46,20 @@ - Server - - - - - - - + Lightwallet Server - + + + + + true + + + + @@ -298,50 +293,6 @@ - - - Troubleshooting - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - - - - Rescan the blockchain for any missing wallet transactions and to correct your wallet balance. This may take several hours. You need to restart hushWallet for this to take effect - - - true - - - - - - - Rescan - - - - - diff --git a/src/txtablemodel.cpp b/src/txtablemodel.cpp index 1b307e6..f296881 100644 --- a/src/txtablemodel.cpp +++ b/src/txtablemodel.cpp @@ -70,15 +70,18 @@ bool TxTableModel::exportToCsv(QString fileName) const { } QString TxTableModel::concatMultipleMemos(const TransactionItem& dat) const { - // Concat all the memos - QString memo; - for (auto item : dat.items) { - if (!item.memo.trimmed().isEmpty()) { - memo += item.address + ": \"" + item.memo + "\"\n"; + if (dat.items.length() == 1) { + return dat.items[0].memo; + } else { + // Concat all the memos + QString memo; + for (auto item : dat.items) { + if (!item.memo.trimmed().isEmpty()) { + memo += item.address + ": \"" + item.memo + "\"\n"; + } } + return memo; } - - return memo; }; QVariant TxTableModel::data(const QModelIndex &index, int role) const {