Skip to content
Snippets Groups Projects
Unverified Commit 66bfbf45 authored by dharjeezy's avatar dharjeezy
Browse files

arc in transaction param for pool

parent b7afe48e
No related merge requests found
......@@ -23,6 +23,7 @@ use sc_network::MAX_RESPONSE_SIZE;
use sc_network_common::ExHashT;
use sp_runtime::traits::Block as BlockT;
use std::{collections::HashMap, future::Future, pin::Pin, time};
use std::sync::Arc;
/// Interval at which we propagate transactions;
pub(crate) const PROPAGATE_TIMEOUT: time::Duration = time::Duration::from_millis(2900);
......@@ -59,11 +60,11 @@ pub trait TransactionPool<H: ExHashT, B: BlockT>: Send + Sync {
/// Get transactions from the pool that are ready to be propagated.
fn transactions(&self) -> Vec<(H, B::Extrinsic)>;
/// Get hash of transaction.
fn hash_of(&self, transaction: &B::Extrinsic) -> H;
fn hash_of(&self, transaction: &Arc<B::Extrinsic>) -> H;
/// Import a transaction into the pool.
///
/// This will return future.
fn import(&self, transaction: B::Extrinsic) -> TransactionImportFuture;
fn import(&self, transaction: Arc<B::Extrinsic>) -> TransactionImportFuture;
/// Notify the pool about transactions broadcast.
fn on_broadcasted(&self, propagations: HashMap<H, Vec<String>>);
/// Get transaction by hash.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment