mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Don't request votes if there is nothing to request. (#5888)
* Don't request votes if there is nothing to request. * Add trace log
This commit is contained in:
@@ -713,6 +713,12 @@ async fn request_votes(
|
||||
sender: &mut impl overseer::ProvisionerSenderTrait,
|
||||
disputes_to_query: Vec<(SessionIndex, CandidateHash)>,
|
||||
) -> Vec<(SessionIndex, CandidateHash, CandidateVotes)> {
|
||||
// No need to send dummy request, if nothing to request:
|
||||
if disputes_to_query.is_empty() {
|
||||
gum::trace!(target: LOG_TARGET, "No disputes, nothing to request - returning empty `Vec`.");
|
||||
|
||||
return Vec::new()
|
||||
}
|
||||
let (tx, rx) = oneshot::channel();
|
||||
// Bounded by block production - `ProvisionerMessage::RequestInherentData`.
|
||||
sender.send_unbounded_message(DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
|
||||
Reference in New Issue
Block a user