Introduce getChannel() by peerId

This commit is contained in:
Roman Mandeleil 2015-01-16 10:28:43 +02:00
parent bbb9e9e303
commit c7638c2617
1 changed files with 17 additions and 0 deletions

View File

@ -47,6 +47,23 @@ public class ChannelManager {
public void init() {
scheduleChannelCollector();
}
public Channel getChannel(String peerId){
for (Channel channel : channels){
String tablePeerId = channel.getP2pHandler().getHandshakeHelloMessage().getPeerId();
if (tablePeerId != null &&
peerId.equals(tablePeerId)){
return channel;
}
}
return null;
}
public void recvTransaction() {
// ???