use of co.rsk.net.Metrics in project rskj by rsksmart.
the class ChannelManagerImpl method broadcastTransactionMessage.
/**
* Propagates the transactions message across active peers with exclusion of
* 'receivedFrom' peer.
*
* @param tx transactions to be sent
* @param receivedFrom the peer which sent original message or null if
* the transactions were originated by this peer
*/
public void broadcastTransactionMessage(List<Transaction> tx, Channel receivedFrom) {
tx.forEach(Metrics::broadcastTransaction);
synchronized (activePeers) {
TransactionsMessage txsmsg = new TransactionsMessage(tx);
EthMessage msg = new RskMessage(config, txsmsg);
for (Channel channel : activePeers.values()) {
if (channel != receivedFrom) {
channel.sendMessage(msg);
}
}
}
}
Aggregations