use of org.ethereum.net.message.ReasonCode in project rskj by rsksmart.
the class ChannelManagerImpl method processNewPeer.
private void processNewPeer(Channel channel, List<Channel> processedChannels) {
ReasonCode reason = getNewPeerDisconnectionReason(channel);
if (reason != null) {
disconnect(channel, reason);
} else {
addToActives(channel);
}
processedChannels.add(channel);
}
use of org.ethereum.net.message.ReasonCode in project rskj by rsksmart.
the class ChannelManagerImpl method processNewPeers.
private void processNewPeers() {
if (!CollectionUtils.isEmpty(newPeers)) {
final List<Channel> processed = new ArrayList<>();
newPeers.stream().filter(Channel::isProtocolsInitialized).forEach(channel -> {
ReasonCode reason = getNewPeerDisconnectionReason(channel);
if (reason == null) {
process(channel);
} else {
disconnect(channel, reason);
}
processed.add(channel);
});
newPeers.removeAll(processed);
}
}
Aggregations