Skip to content

Commit

Permalink
node: remove TxFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Aug 2, 2024
1 parent b1cd3fd commit 36b8ba6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
10 changes: 0 additions & 10 deletions node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,6 @@ pub trait LongLivedService<N: Network, DB: database::DB, VM: vm::VMExecution>:
Ok(())
}

async fn add_filter(
&self,
topic: u8,
filter_fn: BoxedFilter,
network: &Arc<RwLock<N>>,
) -> anyhow::Result<()> {
network.write().await.add_filter(topic, filter_fn).await?;
Ok(())
}

/// Returns service name.
fn name(&self) -> &'static str;
}
Expand Down
20 changes: 0 additions & 20 deletions node/src/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,6 @@ impl Default for MempoolSrv {
}
}

pub struct TxFilter {}
impl crate::Filter for TxFilter {
fn filter(&mut self, _msg: &Message) -> anyhow::Result<()> {
// TODO: Ensure transaction does not exist in the mempool state
// TODO: Ensure transaction does not exist in blockchain
// TODO: Check Nullifier
Ok(())
}
}

#[async_trait]
impl<N: Network, DB: database::DB, VM: vm::VMExecution>
LongLivedService<N, DB, VM> for MempoolSrv
Expand Down Expand Up @@ -85,16 +75,6 @@ impl<N: Network, DB: database::DB, VM: vm::VMExecution>
)
.await?;

// Add a filter that will discard any transactions invalid to the actual
// mempool, blockchain state.
LongLivedService::<N, DB, VM>::add_filter(
self,
Topics::Tx.into(),
Box::new(TxFilter {}),
&network,
)
.await?;

loop {
if let Ok(msg) = self.inbound.recv().await {
match &msg.payload {
Expand Down

0 comments on commit 36b8ba6

Please sign in to comment.