Skip to content

Commit

Permalink
Remove NetworkController's non_owning_clone method
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Sep 16, 2023
1 parent 8dffa39 commit 5e1b265
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion ckb-bin/src/subcommand/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn run(args: RunArgs, version: Version, async_handle: Handle) -> Result<(),
);

let tx_pool_builder = pack.take_tx_pool_builder();
tx_pool_builder.start(network_controller.non_owning_clone());
tx_pool_builder.start(network_controller.clone());

ctrlc::set_handler(|| {
info!("Trapped exit signal, exiting...");
Expand Down
11 changes: 0 additions & 11 deletions network/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,17 +1386,6 @@ impl NetworkController {
let _ignore = ping_controller.try_send(());
}
}

/// Since a non-owning reference does not count towards ownership,
/// it will not prevent the value stored in the allocation from being dropped
pub fn non_owning_clone(&self) -> Self {
NetworkController {
version: self.version.clone(),
network_state: Arc::clone(&self.network_state),
p2p_control: self.p2p_control.clone(),
ping_controller: self.ping_controller.clone(),
}
}
}

// Send an optional message before disconnect a peer
Expand Down

0 comments on commit 5e1b265

Please sign in to comment.