Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fish-sammy authored Feb 12, 2024
2 parents 6fd0cbe + 69124ee commit defc371
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ampd/src/queue/queued_broadcaster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ where
let fee = broadcaster.estimate_fee(vec![msg.clone()]).await.change_context(Error::EstimateFee)?;

if fee.gas_limit + queue.gas_cost() >= self.batch_gas_limit {
interval.reset();
broadcast_all(&mut queue, &mut broadcaster).await?;
interval.reset();
}

let message_type = msg.type_url.clone();
Expand All @@ -135,10 +135,13 @@ where
);
}
},
_ = interval.tick() => broadcast_all(&mut queue, &mut broadcaster).await?,
_ = self.broadcast_rx.recv() => {
_ = interval.tick() => {
broadcast_all(&mut queue, &mut broadcaster).await?;
interval.reset();
},
_ = self.broadcast_rx.recv() => {
broadcast_all(&mut queue, &mut broadcaster).await?;
interval.reset();
},
}
}
Expand Down

0 comments on commit defc371

Please sign in to comment.