From e8aeadf202b3728bfb6c3a8addcc2bd8f0782b0b Mon Sep 17 00:00:00 2001
From: Pierre Krieger <pierre.krieger1708@gmail.com>
Date: Fri, 26 Mar 2021 18:02:41 +0100
Subject: [PATCH] Add NetworkService::add_known_address (#8467)

---
 substrate/client/network/src/service.rs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/substrate/client/network/src/service.rs b/substrate/client/network/src/service.rs
index 54a5559d2ea..bf3a86444b4 100644
--- a/substrate/client/network/src/service.rs
+++ b/substrate/client/network/src/service.rs
@@ -647,6 +647,13 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkService<B, H> {
 			.unbounded_send(ServiceToWorkerMsg::SetReservedOnly(reserved_only));
 	}
 
+	/// Adds an address known to a node.
+	pub fn add_known_address(&mut self, peer_id: PeerId, addr: Multiaddr) {
+		let _ = self
+			.to_worker
+			.unbounded_send(ServiceToWorkerMsg::AddKnownAddress(peer_id, addr));
+	}
+
 	/// Appends a notification to the buffer of pending outgoing notifications with the given peer.
 	/// Has no effect if the notifications channel with this protocol name is not open.
 	///
-- 
GitLab