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]

pub fn handle(&self) -> &Handle[src]

Return reference of tokio runtime handle

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]

Generate and return block_template with block_assembler_config

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]

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]

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]

Submit remote tx with declared cycles and origin to tx-pool

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]

Receive txs from network, try to add txs to tx-pool

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]

Return fresh proposals

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]

Return txs for network

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]

Clears the tx-pool, removing all txs, update snapshot.

pub fn get_all_entry_info(&self) -> Result<TxPoolEntryInfo, AnyError>[src]

TODO(doc): @zhangsoledad

pub fn get_all_ids(&self) -> Result<TxPoolIds, AnyError>[src]

TODO(doc): @zhangsoledad

Trait Implementations

impl Clone for 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]

Performs copy-assignment from source. Read more

impl Drop for TxPoolController[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> AsAny for T where
    T: Any

pub fn as_any(&self) -> &(dyn Any + 'static)

TODO(doc): @quake

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 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<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> Erased for T