diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 53e71698dbe672e657176d9fba2278a7a342865d..f93bba3d574ed6a16a333eefa0e90342e547a174 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -390,7 +390,7 @@ public class SummaryHelper extends HelperBase { buf.append(name.substring(0,15)).append("…"); buf.append("</a></b></td>\n"); LeaseSet ls = _context.netDb().lookupLeaseSetLocally(h); - if (ls != null) { + if (ls != null && _context.tunnelManager().getOutboundClientTunnelCount(h) > 0) { long timeToExpire = ls.getEarliestLeaseDate() - _context.clock().now(); if (timeToExpire < 0) { // red or yellow light diff --git a/router/java/src/net/i2p/router/DummyTunnelManagerFacade.java b/router/java/src/net/i2p/router/DummyTunnelManagerFacade.java index 2adc9ac338baee653181be492ed06d67df55b23e..aef58c3589daf1c42210e013733db7b42299ae33 100644 --- a/router/java/src/net/i2p/router/DummyTunnelManagerFacade.java +++ b/router/java/src/net/i2p/router/DummyTunnelManagerFacade.java @@ -37,6 +37,7 @@ class DummyTunnelManagerFacade implements TunnelManagerFacade { public int getInboundClientTunnelCount() { return 0; } public double getShareRatio() { return 0d; } public int getOutboundClientTunnelCount() { return 0; } + public int getOutboundClientTunnelCount(Hash destination) { return 0; } public long getLastParticipatingExpiration() { return -1; } public void buildTunnels(Destination client, ClientTunnelSettings settings) {} public TunnelPoolSettings getInboundSettings() { return null; } diff --git a/router/java/src/net/i2p/router/TunnelManagerFacade.java b/router/java/src/net/i2p/router/TunnelManagerFacade.java index b1cfd5c2891265e5889d6e56a40bb8b8b061e596..433624779c03c1bc98862b29c53bb6e5ca091aaa 100644 --- a/router/java/src/net/i2p/router/TunnelManagerFacade.java +++ b/router/java/src/net/i2p/router/TunnelManagerFacade.java @@ -51,6 +51,8 @@ public interface TunnelManagerFacade extends Service { public int getInboundClientTunnelCount(); /** how many outbound client tunnels do we have available? */ public int getOutboundClientTunnelCount(); + /** how many outbound client tunnels in this pool? */ + public int getOutboundClientTunnelCount(Hash destination); public double getShareRatio(); /** When does the last tunnel we are participating in expire? */ diff --git a/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java b/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java index fbb2bc77f0cdbbc293bdbb651d625cd6562591d4..db68b507d1fd91243677c4463d68f6779fc31889 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java +++ b/router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java @@ -190,6 +190,21 @@ public class TunnelPoolManager implements TunnelManagerFacade { } return count; } + + /** + * Use to verify a tunnel pool is alive + * @since 0.7.11 + */ + public int getOutboundClientTunnelCount(Hash destination) { + TunnelPool pool = null; + synchronized (_clientOutboundPools) { + pool = _clientOutboundPools.get(destination); + } + if (pool != null) + return pool.getTunnelCount(); + return 0; + } + public int getParticipatingCount() { return _context.tunnelDispatcher().getParticipatingCount(); } public long getLastParticipatingExpiration() { return _context.tunnelDispatcher().getLastParticipatingExpiration(); }