diff --git a/crates/mempool/src/communication.rs b/crates/mempool/src/communication.rs index d02f08b750..3817e27fad 100644 --- a/crates/mempool/src/communication.rs +++ b/crates/mempool/src/communication.rs @@ -50,7 +50,7 @@ impl MempoolCommunicationWrapper { &self, message_metadata: Option, tx: Transaction, - ) -> Result<(), MempoolError> { + ) -> MempoolResult<()> { match message_metadata { Some(message_metadata) => self .mempool_p2p_propagator_client @@ -67,7 +67,11 @@ impl MempoolCommunicationWrapper { async fn add_tx(&mut self, args_wrapper: AddTransactionArgsWrapper) -> MempoolResult<()> { self.mempool.add_tx(args_wrapper.args.clone())?; // TODO: Verify that only transactions that were added to the mempool are sent. - self.send_tx_to_p2p(args_wrapper.p2p_message_metadata, args_wrapper.args.tx).await + // TODO: handle declare correctly and remove this match. + match args_wrapper.args.tx { + Transaction::Declare(_) => Ok(()), + _ => self.send_tx_to_p2p(args_wrapper.p2p_message_metadata, args_wrapper.args.tx).await, + } } fn commit_block(&mut self, args: CommitBlockArgs) -> MempoolResult<()> {