From dac8769e7ef5a8f19e7ead583c072cbbef1ba277 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 23 Feb 2022 22:29:33 +0100 Subject: [PATCH] Multibroadcast: broadcast to selected list --- src/appcontext.cpp | 4 +--- src/utils/nodes.cpp | 5 +++++ src/utils/nodes.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/appcontext.cpp b/src/appcontext.cpp index f33a194..b204b6b 100644 --- a/src/appcontext.cpp +++ b/src/appcontext.cpp @@ -145,9 +145,7 @@ void AppContext::onMultiBroadcast(PendingTransaction *tx) { for (quint64 i = 0; i < count; i++) { QString txData = tx->signedTxToHex(i); - for (const auto& node: this->nodes->websocketNodes()) { - if (!node.online) continue; - + for (const auto& node: this->nodes->nodes()) { QString address = node.toURL(); qDebug() << QString("Relaying %1 to: %2").arg(tx->txid()[i], address); m_rpc->setDaemonAddress(address); diff --git a/src/utils/nodes.cpp b/src/utils/nodes.cpp index f2e06e7..4b94337 100644 --- a/src/utils/nodes.cpp +++ b/src/utils/nodes.cpp @@ -472,6 +472,11 @@ void Nodes::WSNodeExhaustedWarning() { m_wsExhaustedWarningEmitted = true; } +QList Nodes::nodes() { + // Return current node list + return (this->source() == NodeSource::websocket) ? websocketNodes() : m_customNodes; +} + QList Nodes::customNodes() { return m_customNodes; } diff --git a/src/utils/nodes.h b/src/utils/nodes.h index 78f17a9..1cbb298 100644 --- a/src/utils/nodes.h +++ b/src/utils/nodes.h @@ -117,6 +117,7 @@ public: NodeSource source(); FeatherNode connection(); + QList nodes(); QList customNodes(); QList websocketNodes();