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
Return whether tx-pool service is started
Generate and return block_template
Generate and return block_template with block_assembler_config
Notify new uncle
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.
Submit local tx to tx-pool
pub async fn submit_remote_tx(
&self,
tx: TransactionView,
declared_cycles: Cycle,
peer: PeerIndex
) -> Result<(), AnyError>
pub async fn submit_remote_tx(
&self,
tx: TransactionView,
declared_cycles: Cycle,
peer: PeerIndex
) -> Result<(), AnyError>
Submit remote tx with declared cycles and origin to tx-pool
Plug tx-pool entry to tx-pool, skip verification. only for test
Receive txs from network, try to add txs to tx-pool
Return tx-pool information
pub fn fresh_proposals_filter(
&self,
proposals: Vec<ProposalShortId>
) -> Result<Vec<ProposalShortId>, AnyError>
pub fn fresh_proposals_filter(
&self,
proposals: Vec<ProposalShortId>
) -> Result<Vec<ProposalShortId>, AnyError>
Return fresh proposals
pub fn fetch_tx_for_rpc(
&self,
hash: Byte32
) -> Result<Option<(bool, TransactionView)>, AnyError>
pub fn fetch_tx_for_rpc(
&self,
hash: Byte32
) -> Result<Option<(bool, TransactionView)>, AnyError>
Return tx for rpc
Return tx_status for rpc (get_transaction verbosity = 1)
pub fn get_transaction_with_status(
&self,
hash: Byte32
) -> Result<Result<TransactionWithStatus, AnyError>, AnyError>
pub fn get_transaction_with_status(
&self,
hash: Byte32
) -> Result<Result<TransactionWithStatus, AnyError>, AnyError>
Return transaction_with_status for rpc (get_transaction verbosity = 2)
pub fn fetch_txs(
&self,
short_ids: Vec<ProposalShortId>
) -> Result<HashMap<ProposalShortId, TransactionView>, AnyError>
pub fn fetch_txs(
&self,
short_ids: Vec<ProposalShortId>
) -> Result<HashMap<ProposalShortId, TransactionView>, AnyError>
Return txs for network
pub fn fetch_txs_with_cycles(
&self,
short_ids: Vec<ProposalShortId>
) -> Result<Vec<(ProposalShortId, (TransactionView, Cycle))>, AnyError>
pub fn fetch_txs_with_cycles(
&self,
short_ids: Vec<ProposalShortId>
) -> Result<Vec<(ProposalShortId, (TransactionView, Cycle))>, AnyError>
Return txs with cycles
Clears the tx-pool, removing all txs, update snapshot.
TODO(doc): @zhangsoledad
TODO(doc): @zhangsoledad
Sends suspend chunk process cmd
Sends continue chunk process cmd
Trait Implementations
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
Mutably borrows from an owned value. Read more