Changeset 31856e8


Ignore:
Timestamp:
Apr 20, 2019 6:36:43 PM (18 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e70a2c7
Parents:
22aefa2
Message:

Router: Update NTCP checks for NTCP2
Remove old check for 0.6.1.32 and earlier routers

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java

    r22aefa2 r31856e8  
    11051105        }
    11061106        if (upLongEnough && !routerInfo.isCurrent(ROUTER_INFO_EXPIRATION_SHORT)) {
    1107             if (routerInfo.getTargetAddress("NTCP") == null)
     1107            if (routerInfo.getTargetAddresses("NTCP", "NTCP2").isEmpty())
    11081108                return "Peer published > 75m ago, SSU only without introducers";
    11091109        }
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java

    r22aefa2 r31856e8  
    693693
    694694    /**               
    695      * Get the peers the transport layer thinks are unreachable, and
    696      * add in the peers with the SSU peer testing bug,
     695     * Get the peers the transport layer thinks are unreachable,
    697696     * and peers requiring introducers.
    698697     *                 
     
    708707        List<Hash> l = new ArrayList<Hash>(count / 4);
    709708        for (Hash peer : n) {
    710             if (_context.commSystem().wasUnreachable(peer))
     709            if (_context.commSystem().wasUnreachable(peer)) {
    711710                l.add(peer);
    712             else {
    713                 // Blacklist <= 0.6.1.32 SSU-only peers, they don't know if they are unreachable,
    714                 // and we may not know either if they contacted us first, so assume they are.
    715                 // Also blacklist all peers requiring SSU introducers, because either
     711            } else {
     712                // Blacklist all peers requiring SSU introducers, because either
    716713                //  a) it's slow; or
    717714                //  b) it doesn't work very often; or
     
    720717                RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
    721718                if (info != null) {
    722                     String v = info.getVersion();
    723                     // this only works if there is no 0.6.1.34!
    724                     if ((!v.equals("0.6.1.33")) &&
    725                         v.startsWith("0.6.1.") && info.getTargetAddress("NTCP") == null)
    726                         l.add(peer);
    727                     else {
    728719                        RouterAddress ra = info.getTargetAddress("SSU");
    729720                        // peers with no SSU address at all are fine.
    730721                        // as long as they have NTCP
    731722                        if (ra == null) {
    732                             if (info.getTargetAddress("NTCP") == null)
     723                            if (info.getTargetAddresses("NTCP", "NTCP2").isEmpty())
    733724                                l.add(peer);
    734725                            continue;
     
    737728                        if (ra.getOption("ihost0") != null)
    738729                            l.add(peer);
    739                     }
    740730                }
    741731            }
Note: See TracChangeset for help on using the changeset viewer.