From 2cdc1c040928a4d9e5b5dcc3a4ee12ba15b5aa9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Thu, 5 Nov 2020 16:50:04 +0100 Subject: [PATCH] Adds a comment as requested (#1922) * Adds a comment as requested * Update node/core/bitfield-signing/src/lib.rs Co-authored-by: Fedor Sakharov Co-authored-by: Fedor Sakharov --- polkadot/node/core/bitfield-signing/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/polkadot/node/core/bitfield-signing/src/lib.rs b/polkadot/node/core/bitfield-signing/src/lib.rs index 8a35180580..c43915b748 100644 --- a/polkadot/node/core/bitfield-signing/src/lib.rs +++ b/polkadot/node/core/bitfield-signing/src/lib.rs @@ -210,6 +210,10 @@ async fn construct_availability_bitfield( let availability_cores = get_availability_cores(relay_parent, sender).await?; // Wrap the sender in a Mutex to share it between the futures. + // + // We use a `Mutex` here to not `clone` the sender inside the future, because + // cloning the sender will always increase the capacity of the channel by one. + // (for the lifetime of the sender) let sender = Mutex::new(sender); // Handle all cores concurrently