Multibroadcast: broadcast to selected list

This commit is contained in:
tobtoht 2022-02-23 22:29:33 +01:00
parent e2baf86c94
commit dac8769e7e
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
3 changed files with 7 additions and 3 deletions

View 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);

View 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;
}

View file

@ -117,6 +117,7 @@ public:
NodeSource source();
FeatherNode connection();
QList<FeatherNode> nodes();
QList<FeatherNode> customNodes();
QList<FeatherNode> websocketNodes();