Changeset 15165aa


Ignore:
Timestamp:
Jul 8, 2011 1:46:26 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
dd49062
Parents:
c7fcef2
Message:
  • NetDB: Fix NPE at startup (ticket #493)
File:
1 edited

Legend:

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

    rc7fcef2 r15165aa  
    2323import net.i2p.router.util.RandomIterator;
    2424import net.i2p.stat.Rate;
     25import net.i2p.stat.RateStat;
    2526import net.i2p.util.Log;
    2627
     
    202203                PeerProfile prof = _context.profileOrganizer().getProfile(entry);
    203204                double maxGoodRespTime = MAX_GOOD_RESP_TIME;
    204                 Rate tunnelTestTime = _context.statManager().getRate("tunnel.testSuccessTime").getRate(10*60*1000);
    205                 if (tunnelTestTime != null && tunnelTestTime.getAverageValue() > 500)
    206                     maxGoodRespTime = 2 * tunnelTestTime.getAverageValue();
     205                RateStat ttst = _context.statManager().getRate("tunnel.testSuccessTime");
     206                if (ttst != null) {
     207                    Rate tunnelTestTime = ttst.getRate(10*60*1000);
     208                    if (tunnelTestTime != null && tunnelTestTime.getAverageValue() > 500)
     209                        maxGoodRespTime = 2 * tunnelTestTime.getAverageValue();
     210                }
    207211                if (prof != null && prof.getDBHistory() != null
    208212                    && prof.getDbResponseTime().getRate(10*60*1000).getAverageValue() < maxGoodRespTime
Note: See TracChangeset for help on using the changeset viewer.