From a70ae26706c7ca4bfb583d89f09bc5437509413c Mon Sep 17 00:00:00 2001 From: OCamlPro-Iguernlala Date: Tue, 24 Jul 2018 15:54:22 +0200 Subject: [PATCH] P2p: export function 'P2p_pool.score' --- src/lib_p2p/p2p_pool.ml | 4 ++-- src/lib_p2p/p2p_pool.mli | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib_p2p/p2p_pool.ml b/src/lib_p2p/p2p_pool.ml index 0ca8e1e4a..286fd84dc 100644 --- a/src/lib_p2p/p2p_pool.ml +++ b/src/lib_p2p/p2p_pool.ml @@ -633,8 +633,6 @@ module Connection = struct let stat { conn } = P2p_socket.stat conn - let score { peer_meta_config = { score }} meta = score meta - let info { conn } = P2p_socket.info conn @@ -682,6 +680,8 @@ let pool_stat { io_sched } = let config { config } = config +let score { peer_meta_config = { score }} meta = score meta + (***************************************************************************) let fail_unless_disconnected_point point_info = diff --git a/src/lib_p2p/p2p_pool.mli b/src/lib_p2p/p2p_pool.mli index b930d743e..b52072440 100644 --- a/src/lib_p2p/p2p_pool.mli +++ b/src/lib_p2p/p2p_pool.mli @@ -184,6 +184,10 @@ val send_swap_request: ('msg, 'peer_meta,'conn_meta) pool -> unit <> pj), suggest swap with pi for the peer pj. This behaviour is disabled in private mode *) +val score: ('msg, 'peer_meta,'conn_meta) pool -> 'peer_meta -> float +(** [score pool peer_meta] returns the score of a peer in the pool + whose peer_meta is provided *) + (** {2 Pool events} *) module Pool_event : sig