Struct ckb_tx_pool::service::TxPoolController [−][src]
pub struct TxPoolController { /* fields omitted */ }Expand description
Controller to the tx-pool service.
The Controller is internally reference-counted and can be freely cloned. A Controller can be obtained when tx-pool service construct.
Implementations
impl TxPoolController[src]
impl TxPoolController[src]pub fn get_block_template(
&self,
bytes_limit: Option<u64>,
proposals_limit: Option<u64>,
max_version: Option<Version>
) -> Result<Result<BlockTemplate, AnyError>, AnyError>[src]
pub fn get_block_template(
&self,
bytes_limit: Option<u64>,
proposals_limit: Option<u64>,
max_version: Option<Version>
) -> Result<Result<BlockTemplate, AnyError>, AnyError>[src]Generate and return block_template
pub fn get_block_template_with_block_assembler_config(
&self,
bytes_limit: Option<u64>,
proposals_limit: Option<u64>,
max_version: Option<Version>,
block_assembler_config: Option<BlockAssemblerConfig>
) -> Result<Result<BlockTemplate, AnyError>, AnyError>[src]
pub fn get_block_template_with_block_assembler_config(
&self,
bytes_limit: Option<u64>,
proposals_limit: Option<u64>,
max_version: Option<Version>,
block_assembler_config: Option<BlockAssemblerConfig>
) -> Result<Result<BlockTemplate, AnyError>, AnyError>[src]Generate and return block_template with block_assembler_config
pub fn notify_new_uncle(&self, uncle: UncleBlockView) -> Result<(), AnyError>[src]
pub fn notify_new_uncle(&self, uncle: UncleBlockView) -> Result<(), AnyError>[src]Notify new uncle
pub fn update_tx_pool_for_reorg(
&self,
detached_blocks: VecDeque<BlockView>,
attached_blocks: VecDeque<BlockView>,
detached_proposal_id: HashSet<ProposalShortId>,
snapshot: Arc<Snapshot>
) -> Result<(), AnyError>[src]
pub fn update_tx_pool_for_reorg(
&self,
detached_blocks: VecDeque<BlockView>,
attached_blocks: VecDeque<BlockView>,
detached_proposal_id: HashSet<ProposalShortId>,
snapshot: Arc<Snapshot>
) -> Result<(), AnyError>[src]Make tx-pool consistent after a reorg, by re-adding or recursively erasing detached block transactions from the tx-pool, and also removing any other transactions from the tx-pool that are no longer valid given the new tip/height.
pub fn submit_local_tx(
&self,
tx: TransactionView
) -> Result<Result<CacheEntry, Error>, AnyError>[src]
pub fn submit_local_tx(
&self,
tx: TransactionView
) -> Result<Result<CacheEntry, Error>, AnyError>[src]Submit local tx to tx-pool
pub async fn submit_remote_tx(
&self,
tx: TransactionView,
declared_cycles: Cycle,
peer: PeerIndex
) -> Result<Result<CacheEntry, Error>, AnyError>[src]
pub async fn submit_remote_tx(
&self,
tx: TransactionView,
declared_cycles: Cycle,
peer: PeerIndex
) -> Result<Result<CacheEntry, Error>, AnyError>[src]Submit remote tx with declared cycles and origin to tx-pool
pub fn plug_entry(
&self,
entries: Vec<TxEntry>,
target: PlugTarget
) -> Result<(), AnyError>[src]
pub fn plug_entry(
&self,
entries: Vec<TxEntry>,
target: PlugTarget
) -> Result<(), AnyError>[src]Plug tx-pool entry to tx-pool, skip verification. only for test
pub fn notify_txs(&self, txs: Vec<TransactionView>) -> Result<(), AnyError>[src]
pub fn notify_txs(&self, txs: Vec<TransactionView>) -> Result<(), AnyError>[src]Receive txs from network, try to add txs to tx-pool
pub fn get_tx_pool_info(&self) -> Result<TxPoolInfo, AnyError>[src]
pub fn get_tx_pool_info(&self) -> Result<TxPoolInfo, AnyError>[src]Return tx-pool information
pub fn fresh_proposals_filter(
&self,
proposals: Vec<ProposalShortId>
) -> Result<Vec<ProposalShortId>, AnyError>[src]
pub fn fresh_proposals_filter(
&self,
proposals: Vec<ProposalShortId>
) -> Result<Vec<ProposalShortId>, AnyError>[src]Return fresh proposals
pub fn fetch_tx_for_rpc(
&self,
id: ProposalShortId
) -> Result<Option<(bool, TransactionView)>, AnyError>[src]
pub fn fetch_tx_for_rpc(
&self,
id: ProposalShortId
) -> Result<Option<(bool, TransactionView)>, AnyError>[src]Return tx for rpc
pub fn fetch_txs(
&self,
short_ids: Vec<ProposalShortId>
) -> Result<HashMap<ProposalShortId, TransactionView>, AnyError>[src]
pub fn fetch_txs(
&self,
short_ids: Vec<ProposalShortId>
) -> Result<HashMap<ProposalShortId, TransactionView>, AnyError>[src]Return txs for network
pub fn fetch_txs_with_cycles(
&self,
short_ids: Vec<ProposalShortId>
) -> Result<Vec<(ProposalShortId, (TransactionView, Cycle))>, AnyError>[src]
pub fn fetch_txs_with_cycles(
&self,
short_ids: Vec<ProposalShortId>
) -> Result<Vec<(ProposalShortId, (TransactionView, Cycle))>, AnyError>[src]Return txs with cycles
pub fn clear_pool(&self, new_snapshot: Arc<Snapshot>) -> Result<(), AnyError>[src]
pub fn clear_pool(&self, new_snapshot: Arc<Snapshot>) -> Result<(), AnyError>[src]Clears the tx-pool, removing all txs, update snapshot.
pub fn get_all_entry_info(&self) -> Result<TxPoolEntryInfo, AnyError>[src]
pub fn get_all_entry_info(&self) -> Result<TxPoolEntryInfo, AnyError>[src]TODO(doc): @zhangsoledad
pub fn get_all_ids(&self) -> Result<TxPoolIds, AnyError>[src]
pub fn get_all_ids(&self) -> Result<TxPoolIds, AnyError>[src]TODO(doc): @zhangsoledad
Trait Implementations
impl Clone for TxPoolController[src]
impl Clone for TxPoolController[src]fn clone(&self) -> TxPoolController[src]
fn clone(&self) -> TxPoolController[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for TxPoolController
impl Send for TxPoolController
impl Sync for TxPoolController
impl Unpin for TxPoolController
impl !UnwindSafe for TxPoolController
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,