Changeset 85963a5


Ignore:
Timestamp:
May 25, 2009 3:22:01 AM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
235058e
Parents:
c639525
Message:

more fast peers when more local dests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java

    rc639525 r85963a5  
    7777    public static final String PROP_MINIMUM_FAST_PEERS = "profileOrganizer.minFastPeers";
    7878    public static final int DEFAULT_MINIMUM_FAST_PEERS = 8;
     79    private static final int DEFAULT_MAXIMUM_FAST_PEERS = 16;
    7980    /**
    8081     * Defines the minimum number of 'high capacity' peers that the organizer should
     
    11421143     * peers are particularly fast.
    11431144     *
     1145     * Increase default by two for every local destination, up to a max.
     1146     *
    11441147     * @return minimum number of peers to be placed in the 'fast' group
    11451148     */
    11461149    protected int getMinimumFastPeers() {
    1147         return _context.getProperty(PROP_MINIMUM_FAST_PEERS, DEFAULT_MINIMUM_FAST_PEERS);
     1150        int def = Math.min(DEFAULT_MAXIMUM_FAST_PEERS,
     1151                           (2 *_context.clientManager().listClients().size()) + DEFAULT_MINIMUM_FAST_PEERS - 2);
     1152        return _context.getProperty(PROP_MINIMUM_FAST_PEERS, def);
    11481153    }
    11491154   
Note: See TracChangeset for help on using the changeset viewer.