Skip to content

Commit 4362923

Browse files
committed
[addrman] Improve serialization comments
Thanks to Vasil Dimov <[email protected]> for these suggestions
1 parent ac3547e commit 4362923

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/addrman.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -335,23 +335,20 @@ friend class CAddrManTest;
335335
* * nNew
336336
* * nTried
337337
* * number of "new" buckets XOR 2**30
338-
* * all nNew addrinfos in vvNew
339-
* * all nTried addrinfos in vvTried
340-
* * for each bucket:
338+
* * all new addresses (total count: nNew)
339+
* * all tried addresses (total count: nTried)
340+
* * for each new bucket:
341341
* * number of elements
342-
* * for each element: index
342+
* * for each element: index in the serialized "all new addresses"
343343
* * asmap checksum
344344
*
345345
* 2**30 is xorred with the number of buckets to make addrman deserializer v0 detect it
346346
* as incompatible. This is necessary because it did not check the version number on
347347
* deserialization.
348348
*
349-
* Notice that vvTried, mapAddr and vVector are never encoded explicitly;
349+
* vvNew, vvTried, mapInfo, mapAddr and vRandom are never encoded explicitly;
350350
* they are instead reconstructed from the other information.
351351
*
352-
* vvNew is serialized, but only used if ADDRMAN_NEW_BUCKET_COUNT and the asmap checksum
353-
* didn't change, otherwise it is reconstructed as well.
354-
*
355352
* This format is more complex, but significantly smaller (at most 1.5 MiB), and supports
356353
* changes to the ADDRMAN_ parameters without breaking the on-disk structure.
357354
*

0 commit comments

Comments
 (0)