Introduce getChannel() by peerId
This commit is contained in:
parent
bbb9e9e303
commit
c7638c2617
|
@ -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() {
|
||||
// ???
|
||||
|
|
Loading…
Reference in New Issue