mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-10 04:44:52 +00:00
Improve warning message on remote node attack
This commit is contained in:
parent
43d9624f5c
commit
a60326a593
3 changed files with 25 additions and 7 deletions
|
@ -565,10 +565,10 @@ void MainWindow::onConnectionStatusChanged(int status)
|
||||||
|
|
||||||
void MainWindow::onCreateTransactionSuccess(PendingTransaction *tx, const QVector<QString> &address) {
|
void MainWindow::onCreateTransactionSuccess(PendingTransaction *tx, const QVector<QString> &address) {
|
||||||
auto tx_status = tx->status();
|
auto tx_status = tx->status();
|
||||||
auto err = QString("Can't create transaction: ");
|
QString err{"Can't create transaction: "};
|
||||||
|
|
||||||
if(tx_status != PendingTransaction::Status_Ok){
|
if (tx_status != PendingTransaction::Status_Ok){
|
||||||
auto tx_err = tx->errorString();
|
QString tx_err = tx->errorString();
|
||||||
qCritical() << tx_err;
|
qCritical() << tx_err;
|
||||||
|
|
||||||
if (m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_WrongVersion)
|
if (m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_WrongVersion)
|
||||||
|
@ -576,15 +576,25 @@ void MainWindow::onCreateTransactionSuccess(PendingTransaction *tx, const QVecto
|
||||||
else
|
else
|
||||||
err = QString("%1 %2").arg(err).arg(tx_err);
|
err = QString("%1 %2").arg(err).arg(tx_err);
|
||||||
|
|
||||||
|
if (tx_err.contains("Daemon response did not include the requested real output")) {
|
||||||
|
QString currentNode = m_ctx->nodes->connection().toAddress();
|
||||||
|
|
||||||
|
err += QString("\nYou are currently connected to: %1\n\n"
|
||||||
|
"This node may be acting maliciously. You are strongly recommended to disconnect from this node."
|
||||||
|
"Please report this incident to dev@featherwallet.org, #feather on OFTC or /r/FeatherWallet.").arg(currentNode);
|
||||||
|
}
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << err;
|
qDebug() << Q_FUNC_INFO << err;
|
||||||
this->displayWalletErrorMsg(err);
|
this->displayWalletErrorMsg(err);
|
||||||
m_ctx->wallet->disposeTransaction(tx);
|
m_ctx->wallet->disposeTransaction(tx);
|
||||||
} else if (tx->txCount() == 0) {
|
}
|
||||||
|
else if (tx->txCount() == 0) {
|
||||||
err = QString("%1 %2").arg(err).arg("No unmixable outputs to sweep.");
|
err = QString("%1 %2").arg(err).arg("No unmixable outputs to sweep.");
|
||||||
qDebug() << Q_FUNC_INFO << err;
|
qDebug() << Q_FUNC_INFO << err;
|
||||||
this->displayWalletErrorMsg(err);
|
this->displayWalletErrorMsg(err);
|
||||||
m_ctx->wallet->disposeTransaction(tx);
|
m_ctx->wallet->disposeTransaction(tx);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
const auto &description = m_ctx->tmpTxDescription;
|
const auto &description = m_ctx->tmpTxDescription;
|
||||||
|
|
||||||
// Show advanced dialog on multi-destination transactions
|
// Show advanced dialog on multi-destination transactions
|
||||||
|
|
|
@ -69,7 +69,15 @@ QVariant NodeModel::data(const QModelIndex &index, int role) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(role == Qt::BackgroundRole) {
|
else if (role == Qt::ToolTipRole) {
|
||||||
|
switch (index.column()) {
|
||||||
|
case NodeModel::URL: {
|
||||||
|
if (node.isActive)
|
||||||
|
return QString("Feather is connected to this node.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (role == Qt::BackgroundRole) {
|
||||||
if (node.isConnecting)
|
if (node.isConnecting)
|
||||||
return QBrush(ColorScheme::YELLOW.asColor(true));
|
return QBrush(ColorScheme::YELLOW.asColor(true));
|
||||||
else if (node.isActive)
|
else if (node.isActive)
|
||||||
|
|
|
@ -229,7 +229,7 @@ void Nodes::autoConnect(bool forceReconnect) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// try a connect
|
// try a connect
|
||||||
auto node = this->pickEligibleNode();
|
FeatherNode node = this->pickEligibleNode();
|
||||||
this->connectToNode(node);
|
this->connectToNode(node);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue