pub struct TxEntry {Show 13 fields
pub rtx: Arc<ResolvedTransaction>,
pub cycles: Cycle,
pub size: usize,
pub fee: Capacity,
pub ancestors_size: usize,
pub ancestors_fee: Capacity,
pub ancestors_cycles: Cycle,
pub ancestors_count: usize,
pub descendants_fee: Capacity,
pub descendants_size: usize,
pub descendants_cycles: Cycle,
pub descendants_count: usize,
pub timestamp: u64,
}Expand description
An entry in the transaction pool.
Fields§
§rtx: Arc<ResolvedTransaction>Transaction
cycles: CycleCycles
size: usizetx size
fee: Capacityfee
ancestors_size: usizeancestors txs size
ancestors_fee: Capacityancestors txs fee
ancestors_cycles: Cycleancestors txs cycles
ancestors_count: usizeancestors txs count
descendants_fee: Capacitydescendants txs fee
descendants_size: usizedescendants txs size
descendants_cycles: Cycledescendants txs cycles
descendants_count: usizedescendants txs count
timestamp: u64The unix timestamp when entering the Txpool, unit: Millisecond
Implementations§
Source§impl TxEntry
impl TxEntry
Sourcepub fn new(
rtx: Arc<ResolvedTransaction>,
cycles: Cycle,
fee: Capacity,
size: usize,
) -> Self
pub fn new( rtx: Arc<ResolvedTransaction>, cycles: Cycle, fee: Capacity, size: usize, ) -> Self
Create new transaction pool entry
Sourcepub fn new_with_timestamp(
rtx: Arc<ResolvedTransaction>,
cycles: Cycle,
fee: Capacity,
size: usize,
timestamp: u64,
) -> Self
pub fn new_with_timestamp( rtx: Arc<ResolvedTransaction>, cycles: Cycle, fee: Capacity, size: usize, timestamp: u64, ) -> Self
Create new transaction pool entry with specified timestamp
Sourcepub fn dummy_resolve(
tx: TransactionView,
cycles: Cycle,
fee: Capacity,
size: usize,
) -> Self
pub fn dummy_resolve( tx: TransactionView, cycles: Cycle, fee: Capacity, size: usize, ) -> Self
Create dummy entry from tx, skip resolve
Return related dep out_points
Sourcepub fn transaction(&self) -> &TransactionView
pub fn transaction(&self) -> &TransactionView
Return reference of transaction
Sourcepub fn into_transaction(self) -> TransactionView
pub fn into_transaction(self) -> TransactionView
Converts a Entry into a TransactionView This consumes the Entry
Sourcepub fn proposal_short_id(&self) -> ProposalShortId
pub fn proposal_short_id(&self) -> ProposalShortId
Return proposal_short_id of transaction
Sourcepub fn as_score_key(&self) -> AncestorsScoreSortKey
pub fn as_score_key(&self) -> AncestorsScoreSortKey
Returns a sorted_key
Sourcepub fn as_evict_key(&self) -> EvictKey
pub fn as_evict_key(&self) -> EvictKey
Returns a evict_key
Sourcepub fn add_descendant_weight(&mut self, entry: &TxEntry)
pub fn add_descendant_weight(&mut self, entry: &TxEntry)
Update ancestor state for add an entry
Sourcepub fn sub_descendant_weight(&mut self, entry: &TxEntry)
pub fn sub_descendant_weight(&mut self, entry: &TxEntry)
Update ancestor state for remove an entry
Sourcepub fn add_ancestor_weight(&mut self, entry: &TxEntry)
pub fn add_ancestor_weight(&mut self, entry: &TxEntry)
Update ancestor state for add an entry
Sourcepub fn sub_ancestor_weight(&mut self, entry: &TxEntry)
pub fn sub_ancestor_weight(&mut self, entry: &TxEntry)
Update ancestor state for remove an entry
Sourcepub fn reset_statistic_state(&mut self)
pub fn reset_statistic_state(&mut self)
Reset ancestor state by remove
Sourcepub fn to_info(&self) -> TxEntryInfo
pub fn to_info(&self) -> TxEntryInfo
Converts entry to a TxEntryInfo.
Trait Implementations§
Source§impl Ord for TxEntry
impl Ord for TxEntry
Source§impl PartialOrd for TxEntry
impl PartialOrd for TxEntry
impl Eq for TxEntry
Auto Trait Implementations§
impl Freeze for TxEntry
impl RefUnwindSafe for TxEntry
impl Send for TxEntry
impl Sync for TxEntry
impl Unpin for TxEntry
impl UnwindSafe for TxEntry
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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