Rename Message::Inventory -> Message::Inv

I don't feel super strongly about this change, so I'm happy to drop it,
but it makes the parsing match statements line up nicely and aligns
naming with the naming used in Bitcoin.
This commit is contained in:
Henry de Valence 2019-09-25 14:53:13 -07:00 committed by Deirdre Connolly
parent 958fca8e68
commit 422c783a47
2 changed files with 3 additions and 3 deletions

View File

@ -126,7 +126,7 @@ impl Encoder for Codec {
GetBlocks { .. } => b"getblocks\0\0\0",
Headers { .. } => b"headers\0\0\0\0\0",
GetHeaders { .. } => b"getheaders\0\0",
Inventory { .. } => b"inv\0\0\0\0\0\0\0\0\0", // XXX Inventory -> Inv ?
Inv { .. } => b"inv\0\0\0\0\0\0\0\0\0",
GetData { .. } => b"getdata\0\0\0\0\0",
NotFound { .. } => b"notfound\0\0\0\0",
Tx { .. } => b"tx\0\0\0\0\0\0\0\0\0\0",
@ -422,7 +422,7 @@ impl Codec {
hashes.push(InventoryHash::zcash_deserialize(&mut reader)?);
}
Ok(Message::Inventory(hashes))
Ok(Message::Inv(hashes))
}
fn read_getdata<R: Read>(&self, mut _reader: R) -> Result<Message, Error> {

View File

@ -163,7 +163,7 @@ pub enum Message {
// XXX the bitcoin reference above suggests this can be 1.8 MB in bitcoin -- maybe
// larger in Zcash, since Zcash objects could be bigger (?) -- does this tilt towards
// having serialization be async?
Inventory(Vec<InventoryHash>),
Inv(Vec<InventoryHash>),
/// A `getdata` message.
///