mirror of
https://github.com/feather-wallet/feather.git
synced 2025-03-21 06:28:55 +00:00
BroadcastTxDialog: change daemon rpc network if connected to local node
This commit is contained in:
parent
ede6f7e942
commit
3410132033
1 changed files with 7 additions and 11 deletions
|
@ -32,19 +32,15 @@ BroadcastTxDialog::BroadcastTxDialog(QWidget *parent, QSharedPointer<AppContext>
|
||||||
void BroadcastTxDialog::broadcastTx() {
|
void BroadcastTxDialog::broadcastTx() {
|
||||||
QString tx = ui->transaction->toPlainText();
|
QString tx = ui->transaction->toPlainText();
|
||||||
|
|
||||||
QString node = [this]{
|
FeatherNode node = ui->radio_useCustom->isChecked() ? FeatherNode(ui->customNode->text()) : m_ctx->nodes->connection();
|
||||||
QString node;
|
|
||||||
if (ui->radio_useCustom->isChecked())
|
|
||||||
node = ui->customNode->text();
|
|
||||||
else if (ui->radio_useDefault->isChecked())
|
|
||||||
node = m_ctx->nodes->connection().toAddress();
|
|
||||||
|
|
||||||
if (!node.startsWith("http://"))
|
if (node.isLocal()) {
|
||||||
node = QString("http://%1").arg(node);
|
m_rpc->setNetwork(getNetworkClearnet());
|
||||||
return node;
|
} else {
|
||||||
}();
|
m_rpc->setNetwork(getNetworkTor());
|
||||||
|
}
|
||||||
|
|
||||||
m_rpc->setDaemonAddress(node);
|
m_rpc->setDaemonAddress(node.toURL());
|
||||||
m_rpc->sendRawTransaction(tx);
|
m_rpc->sendRawTransaction(tx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue