Struct ckb_tx_pool::pool::TxPool[][src]

pub struct TxPool { /* fields omitted */ }
Expand description

Tx-pool implementation

Implementations

impl TxPool[src]

pub fn new(
    config: TxPoolConfig,
    snapshot: Arc<Snapshot>,
    last_txs_updated_at: Arc<AtomicU64>
) -> TxPool
[src]

Create new TxPool

pub fn snapshot(&self) -> &Snapshot[src]

Tx-pool owned snapshot, it may not consistent with chain cause tx-pool update snapshot asynchronously

pub fn cloned_snapshot(&self) -> Arc<Snapshot>[src]

Makes a clone of the Arc

pub fn info(&self) -> TxPoolInfo[src]

Tx-pool information

pub fn reach_size_limit(&self, tx_size: usize) -> bool[src]

Whether Tx-pool reach size limit

pub fn reach_cycles_limit(&self, cycles: Cycle) -> bool[src]

Whether Tx-pool reach cycles limit

pub fn update_statics_for_add_tx(&mut self, tx_size: usize, cycles: Cycle)[src]

Update size and cycles statics for add tx

pub fn update_statics_for_remove_tx(&mut self, tx_size: usize, cycles: Cycle)[src]

Update size and cycles statics for remove tx cycles overflow is possible, currently obtaining cycles is not accurate

pub fn add_pending(&mut self, entry: TxEntry) -> Result<bool, Reject>[src]

Add tx to pending pool If did have this value present, false is returned.

pub fn add_gap(&mut self, entry: TxEntry) -> Result<bool, Reject>[src]

Add tx which proposed but still uncommittable to gap pool

pub fn add_proposed(&mut self, entry: TxEntry) -> Result<bool, Reject>[src]

Add tx to proposed pool

pub fn get_last_txs_updated_at(&self) -> u64[src]

Get last txs in tx-pool update timestamp

pub fn contains_proposal_id(&self, id: &ProposalShortId) -> bool[src]

Returns true if the tx-pool contains a tx with specified id.

pub fn get_tx_with_cycles(
    &self,
    id: &ProposalShortId
) -> Option<(TransactionView, Cycle)>
[src]

Returns tx with cycles corresponding to the id.

pub fn get_tx(&self, id: &ProposalShortId) -> Option<&TransactionView>[src]

Returns tx corresponding to the id.

pub fn get_tx_without_conflict(
    &self,
    id: &ProposalShortId
) -> Option<&TransactionView>
[src]

Returns tx exclude conflict corresponding to the id. RPC

pub fn get_proposals(
    &self,
    limit: usize,
    exclusion: &HashSet<ProposalShortId>
) -> HashSet<ProposalShortId>
[src]

Get to-be-proposal transactions that may be included in the next block.

pub fn get_tx_from_pool_or_store(
    &self,
    proposal_id: &ProposalShortId
) -> Option<TransactionView>
[src]

Returns tx from tx-pool or storage corresponding to the id.

Auto Trait Implementations

impl !RefUnwindSafe for TxPool

impl Send for TxPool

impl Sync for TxPool

impl Unpin for TxPool

impl !UnwindSafe for TxPool

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, 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