diff --git a/zebra-network/src/protocol/external/message.rs b/zebra-network/src/protocol/external/message.rs index 1bf051a4b..e0e035460 100644 --- a/zebra-network/src/protocol/external/message.rs +++ b/zebra-network/src/protocol/external/message.rs @@ -121,20 +121,15 @@ pub enum Message { data: Option<[u8; 32]>, }, - /// An `addr` message. - /// - /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#addr) - Addr(Vec), - /// A `getaddr` message. /// /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#getaddr) GetAddr, - /// A `block` message. + /// An `addr` message. /// - /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#block) - Block(Arc), + /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#addr) + Addr(Vec), /// A `getblocks` message. /// @@ -155,16 +150,14 @@ pub enum Message { stop: Option, }, - /// A `headers` message. + /// An `inv` message. /// - /// Returns block headers in response to a getheaders packet. + /// Allows a node to advertise its knowledge of one or more + /// objects. It can be received unsolicited, or in reply to + /// `getblocks`. /// - /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#headers) - // Note that the block headers in this packet include a - // transaction count (a var_int, so there can be more than 81 - // bytes per header) as opposed to the block headers that are - // hashed by miners. - Headers(Vec), + /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#inv) + Inv(Vec), /// A `getheaders` message. /// @@ -173,7 +166,7 @@ pub enum Message { /// of its best chain and determine the blocks following the intersection /// point. /// - /// The peer responds with an `headers` packet with the hashes of subsequent blocks. + /// The peer responds with an `headers` packet with the headers of subsequent blocks. /// If supplied, the `stop` parameter specifies the last header to request. /// Otherwise, the maximum number of block headers (160) are sent. /// @@ -185,14 +178,16 @@ pub enum Message { stop: Option, }, - /// An `inv` message. + /// A `headers` message. /// - /// Allows a node to advertise its knowledge of one or more - /// objects. It can be received unsolicited, or in reply to - /// `getblocks`. + /// Returns block headers in response to a getheaders packet. /// - /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#inv) - Inv(Vec), + /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#headers) + // Note that the block headers in this packet include a + // transaction count (a var_int, so there can be more than 81 + // bytes per header) as opposed to the block headers that are + // hashed by miners. + Headers(Vec), /// A `getdata` message. /// @@ -203,17 +198,22 @@ pub enum Message { /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#getdata) GetData(Vec), - /// A `notfound` message. + /// A `block` message. /// - /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#notfound) - // See note above on `Inventory`. - NotFound(Vec), + /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#block) + Block(Arc), /// A `tx` message. /// /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#tx) Tx(Arc), + /// A `notfound` message. + /// + /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#notfound) + // See note above on `Inventory`. + NotFound(Vec), + /// A `mempool` message. /// /// This was defined in [BIP35], which is included in Zcash.