Skip to content

Commit 94073de

Browse files
authored
Merge pull request bitcoin#967 from vasild/bip155_time_and_varint
BIP155: clarify variable integer format and change time to fixed 32 bit
2 parents 60bfc4b + 87ef5aa commit 94073de

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

bip-0155.mediawiki

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The <code>addrv2</code> message is defined as a message where <code>pchCommand =
4646
It is serialized in the standard encoding for P2P messages.
4747
Its format is similar to the current <code>addr</code> message format
4848
<ref>[https://bitcoin.org/en/developer-reference#addr Bitcoin Developer Reference: addr message]</ref>, with the difference that the
49-
fixed 16-byte IP address is replaced by a network ID and a variable-length address, and the time and services format has been changed to VARINT.
49+
fixed 16-byte IP address is replaced by a network ID and a variable-length address, and the services format has been changed to [https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer CompactSize].
5050

5151
This means that the message contains a serialized <code>std::vector</code> of the following structure:
5252

@@ -55,13 +55,13 @@ This means that the message contains a serialized <code>std::vector</code> of th
5555
!Name
5656
!Description
5757
|-
58-
| <code>VARINT</code> (unsigned)
58+
| <code>uint32_t</code>
5959
| <code>time</code>
60-
| Time that this node was last seen as connected to the network. A time in Unix epoch time format, up to 64 bits wide.
60+
| Time that this node was last seen as connected to the network. A time in Unix epoch time format.
6161
|-
62-
| <code>VARINT</code> (unsigned)
62+
| <code>CompactSize</code>
6363
| <code>services</code>
64-
| Service bits. A 64-wide bit field.
64+
| Service bits. A bit field that is 64 bits wide, encoded in [https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer CompactSize].
6565
|-
6666
| <code>uint8_t</code>
6767
| <code>networkID</code>
@@ -144,9 +144,7 @@ The reference implementation is available at (to be done)
144144

145145
==Acknowledgements==
146146

147-
- Jonas Schnelli: change <code>services</code> field to VARINT, to make the message more compact in the likely case instead of always using 8 bytes.
148-
149-
- Luke-Jr: change <code>time</code> field to VARINT, for post-2038 compatibility.
147+
- Jonas Schnelli: change <code>services</code> field to [https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer CompactSize], to make the message more compact in the likely case instead of always using 8 bytes.
150148

151149
- Gregory Maxwell: various suggestions regarding extensibility
152150

0 commit comments

Comments
 (0)