mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-10 04:44:52 +00:00
Fixes for Issues #1,#2,#3 and additionally fixes CMakeLists allow non guix builds.
This commit is contained in:
parent
f4d27d56d4
commit
a530b1ca81
5 changed files with 24 additions and 10 deletions
|
@ -16,12 +16,12 @@ set(COPYRIGHT_YEAR "2024")
|
||||||
set(COPYRIGHT_HOLDERS "The Monero Project")
|
set(COPYRIGHT_HOLDERS "The Monero Project")
|
||||||
|
|
||||||
# Configurable options
|
# 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(SELF_CONTAINED "Disable when building Feather for packages" OFF)
|
||||||
option(TOR_DIR "Directory containing Tor binaries to embed inside Feather" OFF)
|
option(TOR_DIR "Directory containing Tor binaries to embed inside Feather" OFF)
|
||||||
option(CHECK_UPDATES "Enable checking for application updates" ON)
|
option(CHECK_UPDATES "Enable checking for application updates" ON)
|
||||||
option(PLATFORM_INSTALLER "Built-in updater fetches installer (windows-only)" OFF)
|
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(DONATE_BEG "Prompt donation window every once in a while" OFF)
|
||||||
option(WITH_SCANNER "Enable webcam QR scanner" OFF)
|
option(WITH_SCANNER "Enable webcam QR scanner" OFF)
|
||||||
option(STACK_TRACE "Dump stack trace on crash (Linux only)" OFF)
|
option(STACK_TRACE "Dump stack trace on crash (Linux only)" OFF)
|
||||||
|
|
|
@ -302,7 +302,7 @@ if (WITH_SCANNER)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_PLUGIN_ATOMIC)
|
if (WITH_PLUGIN_ATOMIC)
|
||||||
#FIND_PACKAGE(LibArchive REQUIRED)
|
FIND_PACKAGE(LibArchive REQUIRED)
|
||||||
INCLUDE_DIRECTORIES(${LibArchive_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${LibArchive_INCLUDE_DIR})
|
||||||
target_link_libraries(feather PRIVATE ${LibArchive_LIBRARIES})
|
target_link_libraries(feather PRIVATE ${LibArchive_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -136,7 +136,6 @@ void AtomicConfigDialog::extract() {
|
||||||
if (r == ARCHIVE_EOF)
|
if (r == ARCHIVE_EOF)
|
||||||
break;
|
break;
|
||||||
savePath = Config::defaultConfigDir().absolutePath().toStdString().append("/").append(archive_entry_pathname(entry));
|
savePath = Config::defaultConfigDir().absolutePath().toStdString().append("/").append(archive_entry_pathname(entry));
|
||||||
qDebug() << savePath;
|
|
||||||
archive_entry_set_pathname(entry, savePath.c_str());
|
archive_entry_set_pathname(entry, savePath.c_str());
|
||||||
r = archive_write_header(ext, entry);
|
r = archive_write_header(ext, entry);
|
||||||
copy_data(a, ext);
|
copy_data(a, ext);
|
||||||
|
|
|
@ -114,7 +114,6 @@ void AtomicSwap::runSwap(QStringList arguments){
|
||||||
qDebug() << "process started";
|
qDebug() << "process started";
|
||||||
}
|
}
|
||||||
AtomicSwap::~AtomicSwap() {
|
AtomicSwap::~AtomicSwap() {
|
||||||
delete ui;
|
|
||||||
for (const auto& proc : *procList){
|
for (const auto& proc : *procList){
|
||||||
proc->kill();
|
proc->kill();
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,6 +132,7 @@ void AtomicWidget::showAtomicConfigureDialog() {
|
||||||
|
|
||||||
void AtomicWidget::runSwap(const QString& seller, const QString& btcChange, const QString& xmrReceive) {
|
void AtomicWidget::runSwap(const QString& seller, const QString& btcChange, const QString& xmrReceive) {
|
||||||
qDebug() << "starting swap";
|
qDebug() << "starting swap";
|
||||||
|
clean();
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << "--data-base-dir";
|
arguments << "--data-base-dir";
|
||||||
arguments << Config::defaultConfigDir().absolutePath();
|
arguments << Config::defaultConfigDir().absolutePath();
|
||||||
|
@ -173,6 +174,7 @@ void AtomicWidget::list(const QString& rendezvous) {
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << "--data-base-dir";
|
arguments << "--data-base-dir";
|
||||||
arguments << Config::defaultConfigDir().absolutePath();
|
arguments << Config::defaultConfigDir().absolutePath();
|
||||||
|
arguments << "--debug";
|
||||||
if (constants::networkType==NetworkType::STAGENET){
|
if (constants::networkType==NetworkType::STAGENET){
|
||||||
arguments << "--testnet";
|
arguments << "--testnet";
|
||||||
}
|
}
|
||||||
|
@ -184,6 +186,7 @@ void AtomicWidget::list(const QString& rendezvous) {
|
||||||
}
|
}
|
||||||
arguments << "--rendezvous-point";
|
arguments << "--rendezvous-point";
|
||||||
arguments << rendezvous;
|
arguments << rendezvous;
|
||||||
|
qDebug() << "rendezvous point: " + rendezvous;
|
||||||
auto *swap = new QProcess();
|
auto *swap = new QProcess();
|
||||||
procList->append(QSharedPointer<QProcess>(swap));
|
procList->append(QSharedPointer<QProcess>(swap));
|
||||||
swap->setReadChannel(QProcess::StandardError);
|
swap->setReadChannel(QProcess::StandardError);
|
||||||
|
@ -196,13 +199,14 @@ void AtomicWidget::list(const QString& rendezvous) {
|
||||||
|
|
||||||
|
|
||||||
for(const auto& line : lines){
|
for(const auto& line : lines){
|
||||||
|
qDebug() << line;
|
||||||
if(line.contains("status")){
|
if(line.contains("status")){
|
||||||
parsedLine = QJsonDocument::fromJson(line.toLocal8Bit(), &parseError );
|
parsedLine = QJsonDocument::fromJson(line.toLocal8Bit(), &parseError );
|
||||||
if (parsedLine["fields"]["status"].toString().contains("Online")){
|
if (parsedLine["fields"]["status"].toString().contains("Online")){
|
||||||
bool skip = false;
|
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());
|
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){
|
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;
|
skip = true;
|
||||||
}
|
}
|
||||||
if (!skip) {
|
if (!skip) {
|
||||||
|
@ -210,6 +214,9 @@ void AtomicWidget::list(const QString& rendezvous) {
|
||||||
offerList->append(QSharedPointer<OfferEntry>(entry));
|
offerList->append(QSharedPointer<OfferEntry>(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();
|
swap->close();
|
||||||
|
@ -235,16 +242,25 @@ void AtomicWidget::clean() {
|
||||||
for (const auto& proc : *procList){
|
for (const auto& proc : *procList){
|
||||||
proc->kill();
|
proc->kill();
|
||||||
}
|
}
|
||||||
|
auto cleanWallet = new QProcess;
|
||||||
|
auto cleanSwap = new QProcess;
|
||||||
if(conf()->get(Config::operatingSystem)=="WINDOWS"){
|
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 {
|
}else {
|
||||||
if (constants::networkType==NetworkType::STAGENET){
|
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 {
|
} else {
|
||||||
(new QProcess)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() +
|
(cleanWallet)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() +
|
||||||
"/mainnet/monero/monero-wallet-rpc"});
|
"/mainnet/monero/monero-wallet-rpc"});
|
||||||
|
(cleanSwap)->start("pkill", QStringList{"-f", Config::defaultConfigDir().absolutePath() +
|
||||||
|
"/*"});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cleanWallet->waitForFinished();
|
||||||
|
cleanSwap->waitForFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue