pub struct Pool { /* private fields */ }Expand description
An overlay to index the pending txs in the ckb tx pool, currently only supports removals of dead cells from the pending txs
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn transaction_committed(&mut self, tx: &TransactionView)
pub fn transaction_committed(&mut self, tx: &TransactionView)
the tx has been committed in a block, it should be removed from pending dead cells
Sourcepub fn transaction_rejected(&mut self, tx: &TransactionView)
pub fn transaction_rejected(&mut self, tx: &TransactionView)
the tx has been rejected for some reason, it should be removed from pending dead cells
Sourcepub fn new_transaction(&mut self, tx: &TransactionView)
pub fn new_transaction(&mut self, tx: &TransactionView)
a new tx is submitted to the pool, mark its inputs as dead cells
Sourcepub fn is_consumed_by_pool_tx(&self, out_point: &OutPoint) -> bool
pub fn is_consumed_by_pool_tx(&self, out_point: &OutPoint) -> bool
Return weather out_point referred cell consumed by pooled transaction
Sourcepub fn transactions_committed(&mut self, txs: &[TransactionView])
pub fn transactions_committed(&mut self, txs: &[TransactionView])
the txs has been committed in a block, it should be removed from pending dead cells
Sourcepub fn dead_cells(&self) -> impl Iterator<Item = &OutPoint>
pub fn dead_cells(&self) -> impl Iterator<Item = &OutPoint>
return all dead cells
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnwindSafe for Pool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more