Struct TxMemPoolEntry

Source
pub struct TxMemPoolEntry {
Show 24 fields pub tx: Arc<Transaction>, pub fee: Amount, pub modified_fee: Amount, pub tx_weight: Weight, pub time: i64, pub entry_height: u32, pub entry_block_mtp: i64, pub entry_block_hash: BlockHash, pub entry_sequence: u64, pub spends_coinbase: bool, pub sigop_cost: i64, pub lock_points: LockPoints, pub count_with_ancestors: u64, pub size_with_ancestors: i64, pub fees_with_ancestors: Amount, pub sigops_with_ancestors: i64, pub count_with_descendants: u64, pub size_with_descendants: i64, pub fees_with_descendants: Amount, pub parents: HashSet<EntryId>, pub children: HashSet<EntryId>, pub cached_ancestor_key: AncestorScoreKey, pub cached_descendant_key: DescendantScoreKey, pub idx_randomized: Option<usize>,
}
Expand description

Mempool entry with cached ancestor/descendant state.

CRITICAL: Index keys are cached to enable correct reindexing. When mutating ancestor/descendant state, we must:

  1. Capture the old cached key
  2. Remove from indices using the old key
  3. Mutate the entry
  4. Recompute and cache the new key
  5. Reinsert using the new key

Fields§

§tx: Arc<Transaction>

Transaction data.

§fee: Amount

Base fee (without priority adjustments).

§modified_fee: Amount

Modified fee (includes priority delta from prioritise_transaction).

§tx_weight: Weight

Cached transaction weight.

§time: i64

Entry timestamp (seconds since epoch).

§entry_height: u32

Block height when transaction entered mempool.

§entry_block_mtp: i64

Median Time Past of the best block when transaction entered mempool.

§entry_block_hash: BlockHash

Best block hash when transaction entered mempool (for reorg detection).

§entry_sequence: u64

Sequence number for replay protection.

§spends_coinbase: bool

Whether this transaction spends a coinbase output.

§sigop_cost: i64

Signature operation cost.

§lock_points: LockPoints

Lock points for BIP68/BIP112 validation.

§count_with_ancestors: u64

Number of ancestors (including this tx).

§size_with_ancestors: i64

Total size of ancestors in virtual bytes (including this tx).

§fees_with_ancestors: Amount

Total fees of ancestors (including this tx).

§sigops_with_ancestors: i64

Total sigop cost of ancestors (including this tx).

§count_with_descendants: u64

Number of descendants (including this tx).

§size_with_descendants: i64

Total size of descendants in virtual bytes (including this tx).

§fees_with_descendants: Amount

Total fees of descendants (including this tx).

§parents: HashSet<EntryId>

Parent entries (in-mempool dependencies).

§children: HashSet<EntryId>

Child entries (in-mempool dependents).

§cached_ancestor_key: AncestorScoreKey

Cached ancestor score key for efficient reindexing.

§cached_descendant_key: DescendantScoreKey

Cached descendant score key for efficient reindexing.

§idx_randomized: Option<usize>

Position in randomized transaction vector (for relay).

Implementations§

Source§

impl TxMemPoolEntry

Source

pub fn vsize(&self) -> i64

Get transaction virtual size in bytes.

Source

pub fn feerate(&self) -> i64

Get transaction feerate (modified fee / vsize).

Source

pub fn ancestor_feerate(&self) -> i64

Get ancestor feerate.

Source

pub fn descendant_feerate(&self) -> i64

Get descendant feerate.

Source

pub fn signals_rbf(&self) -> bool

Check if transaction signals RBF per BIP125.

Returns true if any input has nSequence < 0xfffffffe. BIP125 Rule: Any nSequence value less than 0xfffffffe signals replaceability.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedConversion for T

§

fn checked_from<T>(t: T) -> Option<Self>
where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
§

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<Src, Dest> IntoTuple<Dest> for Src
where Dest: FromTuple<Src>,

§

fn into_tuple(self) -> Dest

§

impl<T, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> SaturatedConversion for T

§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> JsonSchemaMaybe for T

§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,