Skip to content

Commit

Permalink
protocol: return early if there are no operations to announce
Browse files Browse the repository at this point in the history
  • Loading branch information
gterzian committed Oct 3, 2022
1 parent 32cf614 commit b2930ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions massa-protocol-worker/src/protocol_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ impl ProtocolWorker {
/// - notes nodes as knowing about those operations from now on.
/// - empties the buffer of operations to announce.
async fn announce_ops(&mut self) {
// Quit if empty.
if self.operations_to_announce.is_empty() {
return;
}
let operation_ids = mem::take(&mut self.operations_to_announce);
massa_trace!("protocol.protocol_worker.propagate_operations.begin", {
"operation_ids": operation_ids
Expand Down

0 comments on commit b2930ab

Please sign in to comment.