From 8c0214f461965120349e6a5e85a288ede0141eb0 Mon Sep 17 00:00:00 2001
From: "rearden-grok[bot]"
<317016512+rearden-grok[bot]@users.noreply.github.com>
Date: Tue, 22 Sep 2026 06:45:08 -0700
Subject: [PATCH] net: keep unreachable I2P out of addrman
Core stores an I2P addrv2 row only when -i2psam made the network
reachable. Without that, p2p_addrv2_relay expects getnodeaddresses
network=i2p to be empty even though the row is still relayed.
---
CHANGELOG.md | 4 +++
crates/rbitcoin-net/src/peers.rs | 54 ++++++++++++++++++++++++++++++++
crates/rbitcoin-node/src/run.rs | 3 ++
3 files changed, 61 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 746556ece..885e7198c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,10 @@ before 1.0).
### Fixed
+- **Unreachable I2P stays out of addrman:** without `--i2p-sam`, an addrv2
+ I2P row is relayed and not stored. `getnodeaddresses` `network=i2p` is
+ empty. Core `p2p_addrv2_relay`.
+
- **Orphan parent GETDATA flush cap is 100:** Core
`MAX_PEER_TX_REQUEST_IN_FLIGHT`. A 25-tx ancestor package's missing
parents fit one GetData (was 16).
diff --git a/crates/rbitcoin-net/src/peers.rs b/crates/rbitcoin-net/src/peers.rs
index 11564850b..4a1aaa140 100644
--- a/crates/rbitcoin-net/src/peers.rs
+++ b/crates/rbitcoin-net/src/peers.rs
@@ -1160,6 +1160,8 @@ pub struct PeerHub {
/// Clearnet P2P bind (not onion-only loopback). Needed to gossip `--external-ip`.
clearnet_listen: AtomicBool,
cjdns_reachable: AtomicBool,
+ /// Core `-i2psam`: I2P rows may enter addrman. Off, they are still relayed.
+ i2p_reachable: AtomicBool,
asmap: Mutex