protocols/kad: Extend emitted events with basic information (#2087)

* Expose kbucket range on RoutingUpdated.

* Expose inbound request information.

* Expose whether routing update is new peer.
This commit is contained in:
Max Inden
2021-06-28 14:14:31 +02:00
committed by GitHub
parent e8fed53598
commit 904880f5e9
8 changed files with 163 additions and 52 deletions

View File

@ -98,7 +98,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
// Called when `kademlia` produces an event.
fn inject_event(&mut self, message: KademliaEvent) {
match message {
KademliaEvent::QueryResult { result, .. } => match result {
KademliaEvent::OutboundQueryCompleted { result, .. } => match result {
QueryResult::GetProviders(Ok(ok)) => {
for peer in ok.providers {
println!(