Skip to content

Commit

Permalink
Remove SEARCH_ORPHAN_POOL_TOKEN
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Aug 1, 2024
1 parent 3969cf4 commit 9b0da11
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions sync/src/relayer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ use std::time::{Duration, Instant};
pub const TX_PROPOSAL_TOKEN: u64 = 0;
pub const ASK_FOR_TXS_TOKEN: u64 = 1;
pub const TX_HASHES_TOKEN: u64 = 2;
pub const SEARCH_ORPHAN_POOL_TOKEN: u64 = 3;

pub const MAX_RELAY_PEERS: usize = 128;
pub const MAX_RELAY_TXS_NUM_PER_BATCH: usize = 32767;
Expand Down Expand Up @@ -799,10 +798,6 @@ impl CKBProtocolHandler for Relayer {
nc.set_notify(Duration::from_millis(300), TX_HASHES_TOKEN)
.await
.expect("set_notify at init is ok");
// todo: remove when the asynchronous verification is completed
nc.set_notify(Duration::from_secs(5), SEARCH_ORPHAN_POOL_TOKEN)
.await
.expect("set_notify at init is ok");
}

async fn received(
Expand Down Expand Up @@ -951,9 +946,6 @@ impl CKBProtocolHandler for Relayer {
if nc.remove_notify(TX_HASHES_TOKEN).await.is_err() {
trace_target!(crate::LOG_TARGET_RELAY, "remove v2 relay notify fail");
}
if nc.remove_notify(SEARCH_ORPHAN_POOL_TOKEN).await.is_err() {
trace_target!(crate::LOG_TARGET_RELAY, "remove v2 relay notify fail");
}
for kv_pair in self.shared().state().peers().state.iter() {
let (peer, state) = kv_pair.pair();
if !state.peer_flags.is_2023edition {
Expand All @@ -973,14 +965,6 @@ impl CKBProtocolHandler for Relayer {
}
ASK_FOR_TXS_TOKEN => self.ask_for_txs(nc.as_ref()),
TX_HASHES_TOKEN => self.send_bulk_of_tx_hashes(nc.as_ref()),
// SEARCH_ORPHAN_POOL_TOKEN => {
// if !self.shared.state().orphan_pool().is_empty() {
// tokio::task::block_in_place(|| {
// self.shared.try_search_orphan_pool(&self.chain);
// self.shared.periodic_clean_orphan_pool();
// })
// }
// }
_ => unreachable!(),
}
trace_target!(
Expand Down

0 comments on commit 9b0da11

Please sign in to comment.