]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
Multibroadcast: broadcast to selected list
authortobtoht <thotbot@protonmail.com>
Wed, 23 Feb 2022 21:29:33 +0000 (22:29 +0100)
committertobtoht <thotbot@protonmail.com>
Wed, 23 Feb 2022 21:29:33 +0000 (22:29 +0100)
src/appcontext.cpp
src/utils/nodes.cpp
src/utils/nodes.h

index f33a194d36b652db122035c4bed0c9b6bef5f634..b204b6bdd87dea2e6464bfcf427746c4086eedce 100644 (file)
@@ -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);
index f2e06e72f81a6ddaa5035004516d0bd6f33c8b15..4b943372ffd753a4fbaf0a3c0615b9b97d0d7cf2 100644 (file)
@@ -472,6 +472,11 @@ void Nodes::WSNodeExhaustedWarning() {
     m_wsExhaustedWarningEmitted = true;
 }
 
+QList<FeatherNode> Nodes::nodes() {
+    // Return current node list
+    return (this->source() == NodeSource::websocket) ? websocketNodes() : m_customNodes;
+}
+
 QList<FeatherNode> Nodes::customNodes() {
     return m_customNodes;
 }
index 78f17a9bb70c14098d559307e0a1e8ef8d453bc1..1cbb29882993fc92c61f49b2a8f8500e452bc7ac 100644 (file)
@@ -117,6 +117,7 @@ public:
     NodeSource source();
     FeatherNode connection();
 
+    QList<FeatherNode> nodes();
     QList<FeatherNode> customNodes();
     QList<FeatherNode> websocketNodes();