From 9e9e38a19496c8a98c8a0c38d92f3e9a0d1a9996 Mon Sep 17 00:00:00 2001 From: rustaceanrob Date: Fri, 29 Aug 2025 11:06:32 +0100 Subject: [PATCH] Return `Nonce` in `FeelerData` If one reaches out for a connection while also listening, they may compare nonces in `FeelerData` to determine if they have connected to themselves. --- src/handshake.rs | 1 + src/lib.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/handshake.rs b/src/handshake.rs index d9869dd..a5c9e27 100644 --- a/src/handshake.rs +++ b/src/handshake.rs @@ -171,6 +171,7 @@ impl ConnectionConfig { services: version.services, net_time_difference, reported_height: version.start_height, + nonce, }; let handshake = InitializedHandshake { feeler, diff --git a/src/lib.rs b/src/lib.rs index 24de118..dff038b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,6 +30,8 @@ pub struct FeelerData { pub net_time_difference: i64, /// The reported height of their block chain. pub reported_height: i32, + /// The nonce used to create this connection. + pub nonce: u64, } /// The peer's preferences during this connection. These are updated automatically as the peer