@ Nullable public StoredClientChannel getChannel ( Sha256Hash id , Sha256Hash contractHash ) { lock . lock ( ) ; try { Set < StoredClientChannel > setChannels = mapChannels . get ( id ) ; for ( StoredClientChannel channel : setChannels ) { if ( channel . contract . getTxId ( ) . equals ( contractHash ) ) return channel ; } return null ; } finally { lock . unlock ( ) ; } }
Finds a channel with the given id and contract hash and returns it or returns null .