mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-09 19:13:28 +02:00
[addrman] Improve serialization comments
Thanks to Vasil Dimov <vd@FreeBSD.org> for these suggestions
This commit is contained in:
@@ -335,23 +335,20 @@ public:
|
|||||||
* * nNew
|
* * nNew
|
||||||
* * nTried
|
* * nTried
|
||||||
* * number of "new" buckets XOR 2**30
|
* * number of "new" buckets XOR 2**30
|
||||||
* * all nNew addrinfos in vvNew
|
* * all new addresses (total count: nNew)
|
||||||
* * all nTried addrinfos in vvTried
|
* * all tried addresses (total count: nTried)
|
||||||
* * for each bucket:
|
* * for each new bucket:
|
||||||
* * number of elements
|
* * number of elements
|
||||||
* * for each element: index
|
* * for each element: index in the serialized "all new addresses"
|
||||||
* * asmap checksum
|
* * asmap checksum
|
||||||
*
|
*
|
||||||
* 2**30 is xorred with the number of buckets to make addrman deserializer v0 detect it
|
* 2**30 is xorred with the number of buckets to make addrman deserializer v0 detect it
|
||||||
* as incompatible. This is necessary because it did not check the version number on
|
* as incompatible. This is necessary because it did not check the version number on
|
||||||
* deserialization.
|
* deserialization.
|
||||||
*
|
*
|
||||||
* Notice that vvTried, mapAddr and vVector are never encoded explicitly;
|
* vvNew, vvTried, mapInfo, mapAddr and vRandom are never encoded explicitly;
|
||||||
* they are instead reconstructed from the other information.
|
* they are instead reconstructed from the other information.
|
||||||
*
|
*
|
||||||
* vvNew is serialized, but only used if ADDRMAN_NEW_BUCKET_COUNT and the asmap checksum
|
|
||||||
* didn't change, otherwise it is reconstructed as well.
|
|
||||||
*
|
|
||||||
* This format is more complex, but significantly smaller (at most 1.5 MiB), and supports
|
* This format is more complex, but significantly smaller (at most 1.5 MiB), and supports
|
||||||
* changes to the ADDRMAN_ parameters without breaking the on-disk structure.
|
* changes to the ADDRMAN_ parameters without breaking the on-disk structure.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user