Skip to content

Commit

Permalink
node: Impl empty initialize for databroker and mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
goshawk-3 authored and goshawk-3 committed Feb 27, 2024
1 parent 5feed58 commit ec2ac2c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
9 changes: 9 additions & 0 deletions node/src/databroker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ impl DataBrokerSrv {
impl<N: Network, DB: database::DB, VM: vm::VMExecution>
LongLivedService<N, DB, VM> for DataBrokerSrv
{
async fn initialize(
&mut self,
_network: Arc<RwLock<N>>,
_db: Arc<RwLock<DB>>,
_vm: Arc<RwLock<VM>>,
) -> anyhow::Result<()> {
Ok(())
}

async fn execute(
&mut self,
network: Arc<RwLock<N>>,
Expand Down
4 changes: 2 additions & 2 deletions node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ impl<N: Network, DB: database::DB, VM: vm::VMExecution> Node<N, DB, VM> {

pub async fn initialize(
&self,
service_list: &mut Vec<Box<dyn LongLivedService<N, DB, VM>>>,
services: &mut [Box<dyn LongLivedService<N, DB, VM>>],
) -> anyhow::Result<()> {
// Run lazy-initialization of all registered services
for mut service in service_list.into_iter() {
for service in services.iter_mut() {
info!("initialize service {}", service.name());
service
.initialize(
Expand Down
9 changes: 9 additions & 0 deletions node/src/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ impl crate::Filter for TxFilter {
impl<N: Network, DB: database::DB, VM: vm::VMExecution>
LongLivedService<N, DB, VM> for MempoolSrv
{
async fn initialize(
&mut self,
_network: Arc<RwLock<N>>,
_db: Arc<RwLock<DB>>,
_vm: Arc<RwLock<VM>>,
) -> anyhow::Result<()> {
Ok(())
}

async fn execute(
&mut self,
network: Arc<RwLock<N>>,
Expand Down

0 comments on commit ec2ac2c

Please sign in to comment.