pub struct MemPoolArena { /* private fields */ }Expand description
Arena holding all mempool entries with multi-index support.
Provides O(1) lookups by txid/wtxid and sorted iteration by various criteria.
Implementations§
Source§impl MemPoolArena
impl MemPoolArena
Sourcepub fn insert(&mut self, entry: TxMemPoolEntry) -> EntryId
pub fn insert(&mut self, entry: TxMemPoolEntry) -> EntryId
Insert a new entry into the arena.
Returns the handle to the inserted entry.
Sourcepub fn update_ancestor_state(
&mut self,
id: EntryId,
size_delta: i64,
fee_delta: SignedAmount,
count_delta: i64,
sigops_delta: i64,
)
pub fn update_ancestor_state( &mut self, id: EntryId, size_delta: i64, fee_delta: SignedAmount, count_delta: i64, sigops_delta: i64, )
Update ancestor state and reindex.
CRITICAL: Uses cached keys to remove old entries before mutation.
Sourcepub fn update_descendant_state(
&mut self,
id: EntryId,
size_delta: i64,
fee_delta: SignedAmount,
count_delta: i64,
)
pub fn update_descendant_state( &mut self, id: EntryId, size_delta: i64, fee_delta: SignedAmount, count_delta: i64, )
Update descendant state and reindex.
Sourcepub fn update_modified_fee(&mut self, id: EntryId, new_modified_fee: Amount)
pub fn update_modified_fee(&mut self, id: EntryId, new_modified_fee: Amount)
Update modified fee (priority adjustment) and reindex.
Sourcepub fn get(&self, id: EntryId) -> Option<&TxMemPoolEntry>
pub fn get(&self, id: EntryId) -> Option<&TxMemPoolEntry>
Get entry by ID (immutable).
Sourcepub fn get_mut(&mut self, id: EntryId) -> Option<&mut TxMemPoolEntry>
pub fn get_mut(&mut self, id: EntryId) -> Option<&mut TxMemPoolEntry>
Get entry by ID (mutable).
Sourcepub fn get_by_txid(&self, txid: &Txid) -> Option<EntryId>
pub fn get_by_txid(&self, txid: &Txid) -> Option<EntryId>
Lookup entry ID by txid.
Sourcepub fn get_by_wtxid(&self, wtxid: &Wtxid) -> Option<EntryId>
pub fn get_by_wtxid(&self, wtxid: &Wtxid) -> Option<EntryId>
Lookup entry ID by wtxid.
Sourcepub fn remove(&mut self, id: EntryId) -> Option<TxMemPoolEntry>
pub fn remove(&mut self, id: EntryId) -> Option<TxMemPoolEntry>
Remove entry from arena.
Returns the removed entry if it existed.
Sourcepub fn iter_by_ancestor_score(
&self,
) -> impl Iterator<Item = (EntryId, &TxMemPoolEntry)>
pub fn iter_by_ancestor_score( &self, ) -> impl Iterator<Item = (EntryId, &TxMemPoolEntry)>
Iterate entries sorted by ancestor score (highest fee first).
This is the mining order.
Sourcepub fn iter_by_descendant_score(
&self,
) -> impl Iterator<Item = (EntryId, &TxMemPoolEntry)>
pub fn iter_by_descendant_score( &self, ) -> impl Iterator<Item = (EntryId, &TxMemPoolEntry)>
Iterate entries sorted by descendant score (lowest fee first).
This is the eviction order.
Sourcepub fn iter_by_entry_time(
&self,
) -> impl Iterator<Item = (EntryId, &TxMemPoolEntry)>
pub fn iter_by_entry_time( &self, ) -> impl Iterator<Item = (EntryId, &TxMemPoolEntry)>
Iterate entries sorted by entry time (oldest first).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemPoolArena
impl RefUnwindSafe for MemPoolArena
impl Send for MemPoolArena
impl Sync for MemPoolArena
impl Unpin for MemPoolArena
impl UnwindSafe for MemPoolArena
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
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.