mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-31 12:25:40 +00:00
proposer: return optional block (#2834)
This opens up the proposer to only optionally create blocks. Nodes may only make blocks when there are transactions or the chain is scheduled. --------- Co-authored-by: command-bot <>
This commit is contained in:
@@ -203,7 +203,7 @@ where
|
||||
.await
|
||||
);
|
||||
|
||||
let (collation, _, post_hash) = try_request!(
|
||||
let maybe_collation = try_request!(
|
||||
collator
|
||||
.collate(
|
||||
&parent_header,
|
||||
@@ -220,8 +220,14 @@ where
|
||||
.await
|
||||
);
|
||||
|
||||
let result_sender = Some(collator.collator_service().announce_with_barrier(post_hash));
|
||||
request.complete(Some(CollationResult { collation, result_sender }));
|
||||
if let Some((collation, _, post_hash)) = maybe_collation {
|
||||
let result_sender =
|
||||
Some(collator.collator_service().announce_with_barrier(post_hash));
|
||||
request.complete(Some(CollationResult { collation, result_sender }));
|
||||
} else {
|
||||
request.complete(None);
|
||||
tracing::debug!(target: crate::LOG_TARGET, "No block proposal");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user