diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ba6b1c..13fd799 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,12 +16,12 @@ set(COPYRIGHT_YEAR "2024") set(COPYRIGHT_HOLDERS "The Monero Project") # Configurable options -option(STATIC "Link libraries statically, requires static Qt" ON) +option(STATIC "Link libraries statically, requires static Qt" OFF) option(SELF_CONTAINED "Disable when building Feather for packages" OFF) option(TOR_DIR "Directory containing Tor binaries to embed inside Feather" OFF) option(CHECK_UPDATES "Enable checking for application updates" ON) option(PLATFORM_INSTALLER "Built-in updater fetches installer (windows-only)" OFF) -option(USE_DEVICE_TREZOR "Trezor support compilation" ON) +option(USE_DEVICE_TREZOR "Trezor support compilation" OFF) option(DONATE_BEG "Prompt donation window every once in a while" OFF) option(WITH_SCANNER "Enable webcam QR scanner" OFF) option(STACK_TRACE "Dump stack trace on crash (Linux only)" OFF) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index df13768..b9beb2a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -302,7 +302,7 @@ if (WITH_SCANNER) endif() if (WITH_PLUGIN_ATOMIC) - #FIND_PACKAGE(LibArchive REQUIRED) + FIND_PACKAGE(LibArchive REQUIRED) INCLUDE_DIRECTORIES(${LibArchive_INCLUDE_DIR}) target_link_libraries(feather PRIVATE ${LibArchive_LIBRARIES}) endif() diff --git a/src/plugins/atomic/AtomicConfigDialog.cpp b/src/plugins/atomic/AtomicConfigDialog.cpp index 8780eb7..5eb3a3a 100644 --- a/src/plugins/atomic/AtomicConfigDialog.cpp +++ b/src/plugins/atomic/AtomicConfigDialog.cpp @@ -136,7 +136,6 @@ void AtomicConfigDialog::extract() { if (r == ARCHIVE_EOF) break; savePath = Config::defaultConfigDir().absolutePath().toStdString().append("/").append(archive_entry_pathname(entry)); - qDebug() << savePath; archive_entry_set_pathname(entry, savePath.c_str()); r = archive_write_header(ext, entry); copy_data(a, ext); diff --git a/src/plugins/atomic/AtomicSwap.cpp b/src/plugins/atomic/AtomicSwap.cpp index 5862ee8..72faeb2 100644 --- a/src/plugins/atomic/AtomicSwap.cpp +++ b/src/plugins/atomic/AtomicSwap.cpp @@ -114,7 +114,6 @@ void AtomicSwap::runSwap(QStringList arguments){ qDebug() << "process started"; } AtomicSwap::~AtomicSwap() { - delete ui; for (const auto& proc : *procList){ proc->kill(); } diff --git a/src/plugins/atomic/AtomicWidget.cpp b/src/plugins/atomic/AtomicWidget.cpp index 63c86e4..9011259 100644 --- a/src/plugins/atomic/AtomicWidget.cpp +++ b/src/plugins/atomic/AtomicWidget.cpp @@ -132,6 +132,7 @@ void AtomicWidget::showAtomicConfigureDialog() { void AtomicWidget::runSwap(const QString& seller, const QString& btcChange, const QString& xmrReceive) { qDebug() << "starting swap"; + clean(); QStringList arguments; arguments << "--data-base-dir"; arguments << Config::defaultConfigDir().absolutePath(); @@ -173,6 +174,7 @@ void AtomicWidget::list(const QString& rendezvous) { QStringList arguments; arguments << "--data-base-dir"; arguments << Config::defaultConfigDir().absolutePath(); + arguments << "--debug"; if (constants::networkType==NetworkType::STAGENET){ arguments << "--testnet"; } @@ -184,6 +186,7 @@ void AtomicWidget::list(const QString& rendezvous) { } arguments << "--rendezvous-point"; arguments << rendezvous; + qDebug() << "rendezvous point: " + rendezvous; auto *swap = new QProcess(); procList->append(QSharedPointer(swap)); swap->setReadChannel(QProcess::StandardError); @@ -196,13 +199,14 @@ void AtomicWidget::list(const QString& rendezvous) { for(const auto& line : lines){ + qDebug() << line; if(line.contains("status")){ parsedLine = QJsonDocument::fromJson(line.toLocal8Bit(), &parseError ); if (parsedLine["fields"]["status"].toString().contains("Online")){ bool skip = false; auto entry = new OfferEntry(parsedLine["fields"]["price"].toString().split( ' ')[0].toDouble(),parsedLine["fields"]["min_quantity"].toString().split(' ')[0].toDouble(),parsedLine["fields"]["max_quantity"].toString().split(' ')[0].toDouble(), parsedLine["fields"]["address"].toString()); for(const auto& post : *offerList){ - if(std::equal(entry->address.begin(), entry->address.end(),post->address.begin(),post->address.end())) + if(entry->max == 0 || std::equal(entry->address.begin(), entry->address.end(),post->address.begin(),post->address.end())) skip = true; } if (!skip) { @@ -210,6 +214,9 @@ void AtomicWidget::list(const QString& rendezvous) { offerList->append(QSharedPointer(entry)); } } + } else if (line.contains("GLIBC_")){ + QMessageBox::critical(this, "GLIBC outdated", "Upgrade your GLIBC to at least 2.32 to use this tool"); + clean(); } } swap->close(); @@ -233,18 +240,27 @@ AtomicWidget::~AtomicWidget() { void AtomicWidget::clean() { for (const auto& proc : *procList){ - proc->kill(); + proc->kill(); } + auto cleanWallet = new QProcess; + auto cleanSwap = new QProcess; if(conf()->get(Config::operatingSystem)=="WINDOWS"){ - (new QProcess)->start("tskill", QStringList{"monero-wallet-rpc"}); + (cleanWallet)->start("tskill", QStringList{"monero-wallet-rpc"}); + (cleanWallet)->start("tskill", QStringList{"swap"}); }else { if (constants::networkType==NetworkType::STAGENET){ - (new QProcess)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() +"/testnet/monero/monero-wallet-rpc"}); + (cleanWallet)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() +"/testnet/monero/monero-wallet-rpc"}); + (cleanSwap)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() + + "/*"}); } else { - (new QProcess)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() + + (cleanWallet)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() + "/mainnet/monero/monero-wallet-rpc"}); + (cleanSwap)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() + + "/*"}); } } + cleanWallet->waitForFinished(); + cleanSwap->waitForFinished(); }