mirror of
https://github.com/wownero/wowlet.git
synced 2026-12-01 20:44:27 +01:00
BroadcastTxDialog: change daemon rpc network if connected to local node
This commit is contained in:
@@ -32,19 +32,15 @@ BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer<AppContext>
|
||||
void BroadcastTxDialog::broadcastTx() {
|
||||
QString tx = ui->transaction->toPlainText();
|
||||
|
||||
QString node = [this]{
|
||||
QString node;
|
||||
if (ui->radio_useCustom->isChecked())
|
||||
node = ui->customNode->text();
|
||||
else if (ui->radio_useDefault->isChecked())
|
||||
node = m_ctx->nodes->connection().toAddress();
|
||||
FeatherNode node = ui->radio_useCustom->isChecked() ? FeatherNode(ui->customNode->text()) : m_ctx->nodes->connection();
|
||||
|
||||
if (!node.startsWith("http://"))
|
||||
node = QString("http://%1").arg(node);
|
||||
return node;
|
||||
}();
|
||||
if (node.isLocal()) {
|
||||
m_rpc->setNetwork(getNetworkClearnet());
|
||||
} else {
|
||||
m_rpc->setNetwork(getNetworkTor());
|
||||
}
|
||||
|
||||
m_rpc->setDaemonAddress(node);
|
||||
m_rpc->setDaemonAddress(node.toURL());
|
||||
m_rpc->sendRawTransaction(tx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user