mirror of
https://github.com/feather-wallet/feather.git
synced 2024-11-18 02:07:41 +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() {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue