Search in sources :

Example 1 with MessageChannel

use of co.rsk.net.MessageChannel in project rskj by rsksmart.

the class SimpleChannelManager method getMockedChannel.

private Channel getMockedChannel(MessageChannel mc) {
    Channel channel = mock(Channel.class);
    when(channel.getNodeId()).thenReturn(mc.getPeerNodeID());
    return channel;
}
Also used : Channel(org.ethereum.net.server.Channel) MessageChannel(co.rsk.net.MessageChannel) SimpleNodeChannel(co.rsk.net.simples.SimpleNodeChannel)

Example 2 with MessageChannel

use of co.rsk.net.MessageChannel in project rskj by rsksmart.

the class SimpleChannelManager method getMessageChannel.

public MessageChannel getMessageChannel(SimpleNode sender, SimpleNode receiver) {
    MessageChannel channel = simpleChannels.get(sender.getNodeID());
    if (channel != null) {
        return channel;
    }
    channel = new SimpleNodeChannel(sender, receiver);
    simpleChannels.put(channel.getPeerNodeID(), channel);
    return channel;
}
Also used : MessageChannel(co.rsk.net.MessageChannel) SimpleNodeChannel(co.rsk.net.simples.SimpleNodeChannel)

Aggregations

MessageChannel (co.rsk.net.MessageChannel)2 SimpleNodeChannel (co.rsk.net.simples.SimpleNodeChannel)2 Channel (org.ethereum.net.server.Channel)1