diff options
| author | tv <tv@krebsco.de> | 2026-10-28 11:44:49 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-28 11:44:49 +0100 |
| commit | f2c6d836172ffc36ebc631dc0d92d044972d2f44 (patch) | |
| tree | 87e3c3da082c5596232164f352f2cd930fcad224 /src | |
| parent | 45fc20768cf654d557151ca578c3545a867fa15e (diff) | |
fix a_direct_connection_wins_over_a_relayed_one
Diffstat (limited to 'src')
| -rw-r--r-- | src/transport/libp2p.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/transport/libp2p.rs b/src/transport/libp2p.rs index bfd9b52..ba97fb5 100644 --- a/src/transport/libp2p.rs +++ b/src/transport/libp2p.rs @@ -1955,6 +1955,8 @@ mod tests { book.location(&both).map(|address| address.to_string()), Some("/ip4/10.0.0.3/tcp/1".to_owned()) ); + let connections = book.stats().connections; + assert_eq!((connections.direct, connections.relayed), (1, 2)); // Of several, the oldest direct one stays; a relayed one only without a direct. connect(&mut book, both, false); assert_eq!( @@ -1965,7 +1967,5 @@ mod tests { ] ); assert!(book.duplicates(&relayed_only).is_empty()); - let connections = book.stats().connections; - assert_eq!((connections.direct, connections.relayed), (1, 2)); } } |
