aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/libp2p/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 20:53:22 +0100
committertv <tv@krebsco.de>2026-10-31 20:53:22 +0100
commitfb20fcc6d1036fe6de86f2b4388fb55951d9c6ac (patch)
treeb03791f51e1c22c83b388a33b43c100b9ce68867 /src/transport/libp2p/mod.rs
parent78a927449c87225a4d811f8c1a419584e45e5109 (diff)
libp2p: add prefer option
Diffstat (limited to 'src/transport/libp2p/mod.rs')
-rw-r--r--src/transport/libp2p/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/transport/libp2p/mod.rs b/src/transport/libp2p/mod.rs
index f1006e3..0e15a09 100644
--- a/src/transport/libp2p/mod.rs
+++ b/src/transport/libp2p/mod.rs
@@ -45,7 +45,8 @@
//!
//! With `--libp2p-ignore`, address ranges are left out (VPNs): not published, not told
//! peers by identify (`Identifying`), not offered for hole punching, not dialled, and
-//! connections there refused (`Ignoring`).
+//! connections there refused (`Ignoring`). With `--libp2p-prefer`, addresses in the
+//! ranges named come first, where only so many are kept (`Book::preference`).
//!
//! With `--libp2p-upnp`, a node asks its router to forward its listen ports (UPnP), and
//! publishes the router's public address for them with its own (`Book::direct`): then
@@ -239,6 +240,7 @@ impl Libp2pTransport {
let mut book = Book {
announced: config.announce,
ignored: config.ignore.clone(),
+ preferred: config.prefer.clone(),
serving: config.relay,
..Book::default()
};