Changeset 6ad4cb0 for router


Ignore:
Timestamp:
Jan 4, 2017 2:47:52 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f0e6baa
Parents:
9116394
Message:

Data: No longer sort addresses in an RI by SHA256,
it's undocumented, the other router implementations don't do it,
and unnecessary since we store addresses in a List, not a Set,
as of 0.8.14 2012-05

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/data/router/RouterInfo.java

    r9116394 r6ad4cb0  
    6363    private volatile long _published;
    6464    /**
    65      *  Addresses must be sorted by SHA256.
    66      *  When an RI is created, they are sorted in setAddresses().
    67      *  Save addresses in the order received so we need not resort.
     65     *  Save addresses in the order received so the signature works.
    6866     */
    6967    private final List<RouterAddress> _addresses;
     
    206204     * can be contacted.
    207205     *
    208      * Warning - Sorts the addresses here. Do not modify any address
    209      *           after calling this, as the sort order is based on the
    210      *           hash of the entire address structure.
    211      *
    212206     * @param addresses may be null
    213207     * @throws IllegalStateException if RouterInfo is already signed or addresses previously set
     
    218212        if (addresses != null) {
    219213            _addresses.addAll(addresses);
    220             if (_addresses.size() > 1) {
    221                 // WARNING this sort algorithm cannot be changed, as it must be consistent
    222                 // network-wide. The signature is not checked at readin time, but only
    223                 // later, and the addresses are stored in a Set, not a List.
    224                 SortHelper.sortStructureList(_addresses);
    225             }
    226214        }
    227215    }
Note: See TracChangeset for help on using the changeset viewer.