Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move ExecutionExtensions comment around
  • Loading branch information
expenses committed Jul 9, 2020
commit fbb48b95143a220892176e447ad56c9d090d0b3b
9 changes: 4 additions & 5 deletions client/api/src/execution_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ pub struct ExecutionExtensions<Block: traits::Block> {
keystore: Option<BareCryptoStorePtr>,
// FIXME: these two are only RwLock because of https://github.com/paritytech/substrate/issues/4587
// remove when fixed.
// To break retain cycle between `Client` and `TransactionPool` we require this
// extension to be a `Weak` reference.
// That's also the reason why it's being registered lazily instead of
// during initialization.
transaction_pool: RwLock<Option<Weak<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>>>,
extensions_factory: RwLock<Box<dyn ExtensionsFactory>>,
}
Expand Down Expand Up @@ -121,11 +125,6 @@ impl<Block: traits::Block> ExecutionExtensions<Block> {
}

/// Register transaction pool extension.
///
/// To break retain cycle between `Client` and `TransactionPool` we require this
/// extension to be a `Weak` reference.
/// That's also the reason why it's being registered lazily instead of
/// during initialization.
pub fn register_transaction_pool<T>(&self, pool: &Arc<T>)
where T: sp_transaction_pool::OffchainSubmitTransaction<Block> + 'static
{
Expand Down