P2p: do not send bootstrap message to peers in private mode
This commit is contained in:
parent
6663109639
commit
6bbdf13bc5
@ -409,13 +409,14 @@ let write_all pool msg =
|
|||||||
pool.connected_peer_ids
|
pool.connected_peer_ids
|
||||||
|
|
||||||
let broadcast_bootstrap_msg pool =
|
let broadcast_bootstrap_msg pool =
|
||||||
P2p_peer.Table.iter
|
if not pool.config.private_mode then
|
||||||
(fun _peer_id peer_info ->
|
P2p_peer.Table.iter
|
||||||
match P2p_peer_state.get peer_info with
|
(fun _peer_id peer_info ->
|
||||||
| Running { data = { conn } } ->
|
match P2p_peer_state.get peer_info with
|
||||||
ignore (P2p_socket.write_now conn Bootstrap : bool tzresult )
|
| Running { data = { conn } } ->
|
||||||
| _ -> ())
|
ignore (P2p_socket.write_now conn Bootstrap : bool tzresult )
|
||||||
pool.connected_peer_ids
|
| _ -> ())
|
||||||
|
pool.connected_peer_ids
|
||||||
|
|
||||||
|
|
||||||
(***************************************************************************)
|
(***************************************************************************)
|
||||||
|
@ -292,8 +292,9 @@ val write_all: ('msg, 'peer_meta,'conn_meta) pool -> 'msg -> unit
|
|||||||
connections to [pool] in [Running] state. *)
|
connections to [pool] in [Running] state. *)
|
||||||
|
|
||||||
val broadcast_bootstrap_msg: ('msg, 'peer_meta,'conn_meta) pool -> unit
|
val broadcast_bootstrap_msg: ('msg, 'peer_meta,'conn_meta) pool -> unit
|
||||||
(** [write_all pool msg] is [P2P_connection.write_now conn Bootstrap]
|
(** [broadcast_bootstrap_msg pool] is [P2P_connection.write_now conn Bootstrap]
|
||||||
for all member connections to [pool] in [Running] state. *)
|
for all member connections to [pool] in [Running] state.
|
||||||
|
This behavior is deactivated if the node is in private mode *)
|
||||||
|
|
||||||
val greylist_addr : ('msg, 'peer_meta,'conn_meta) pool -> P2p_addr.t -> unit
|
val greylist_addr : ('msg, 'peer_meta,'conn_meta) pool -> P2p_addr.t -> unit
|
||||||
(** [greylist_addr pool addr] adds [addr] to [pool]'s IP greylist. *)
|
(** [greylist_addr pool addr] adds [addr] to [pool]'s IP greylist. *)
|
||||||
|
Loading…
Reference in New Issue
Block a user