From 98079c9d77f9d98f9623a6f348b29fcfbfaadac6 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Thu, 14 Nov 2019 17:14:12 -0500 Subject: [PATCH] Support Mempool message This does not yet push requests into services that actually respond with transaction hashes in our node's mempool, which doesn't exist yet. Pertains to #26 --- zebra-network/src/protocol/codec.rs | 4 ++-- zebra-network/src/protocol/message.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zebra-network/src/protocol/codec.rs b/zebra-network/src/protocol/codec.rs index aebb2646..52f98d5d 100644 --- a/zebra-network/src/protocol/codec.rs +++ b/zebra-network/src/protocol/codec.rs @@ -258,7 +258,7 @@ impl Codec { writer.write_u32::(version.0)?; transaction.zcash_serialize(&mut writer)? } - // Mempool => {} + Mempool => { /* Empty payload -- no-op */ } // FilterLoad => {} // FilterAdd => {} // FilterClear => {} @@ -557,7 +557,7 @@ impl Codec { } fn read_mempool(&self, mut _reader: R) -> Result { - return Err(Error::Parse("mempool messages are not implemented")); + Ok(Message::Mempool) } fn read_filterload(&self, mut _reader: R) -> Result { diff --git a/zebra-network/src/protocol/message.rs b/zebra-network/src/protocol/message.rs index 7c9bde4a..a391e04d 100644 --- a/zebra-network/src/protocol/message.rs +++ b/zebra-network/src/protocol/message.rs @@ -272,7 +272,7 @@ pub enum Message { /// /// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#mempool) /// [BIP35]: https://github.com/bitcoin/bips/blob/master/bip-0035.mediawiki - Mempool {/* XXX add fields */}, + Mempool, /// A `filterload` message. ///