From c65a93b00ecb62a04a90b3899dbbd9d1ba328d79 Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Sun, 29 Mar 2020 00:35:32 +0300 Subject: [PATCH] log public key in weight calculation --- protocols/kad/src/behaviour.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/protocols/kad/src/behaviour.rs b/protocols/kad/src/behaviour.rs index d8166fa3..9a774ea1 100644 --- a/protocols/kad/src/behaviour.rs +++ b/protocols/kad/src/behaviour.rs @@ -702,7 +702,12 @@ where let addresses = contact.addresses.clone(); let peer = entry.key().preimage().clone(); let weight = trust.weight(contact.public_key.clone()).unwrap_or(0); - println!("Calculated weight for {}: {}", entry.key().preimage().to_base58(), weight); + println!( + "Calculated weight for {} pk {}: {}", + entry.key().preimage().to_base58(), + bs58::encode(contact.public_key.encode().to_vec().as_slice()).into_string(), + weight + ); match entry.insert(contact, status, weight) { kbucket::InsertResult::Inserted => { Some(