Struct ckb_tx_pool::TxEntry
source · [−]pub struct TxEntry {
pub rtx: 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 timestamp: u64,
}Expand description
An entry in the transaction pool.
Fields
rtx: ResolvedTransactionTransaction
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
timestamp: u64The unix timestamp when entering the Txpool, unit: Millisecond
Implementations
sourceimpl TxEntry
impl TxEntry
sourcepub fn new(
rtx: ResolvedTransaction,
cycles: Cycle,
fee: Capacity,
size: usize
) -> Self
pub fn new(
rtx: ResolvedTransaction,
cycles: Cycle,
fee: Capacity,
size: usize
) -> Self
Create new transaction pool entry
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 proposal_short_id(&self) -> ProposalShortId
pub fn proposal_short_id(&self) -> ProposalShortId
Return proposal_short_id of transaction
sourcepub fn as_sorted_key(&self) -> AncestorsScoreSortKey
pub fn as_sorted_key(&self) -> AncestorsScoreSortKey
Returns a sorted_key
sourcepub fn add_entry_weight(&mut self, entry: &TxEntry)
pub fn add_entry_weight(&mut self, entry: &TxEntry)
Update ancestor state for add an entry
sourcepub fn sub_entry_weight(&mut self, entry: &TxEntry)
pub fn sub_entry_weight(&mut self, entry: &TxEntry)
Update ancestor state for remove an entry
sourcepub fn reset_ancestors_state(&mut self)
pub fn reset_ancestors_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
sourceimpl Ord for TxEntry
impl Ord for TxEntry
sourceimpl PartialOrd<TxEntry> for TxEntry
impl PartialOrd<TxEntry> for TxEntry
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Eq for TxEntry
impl StructuralEq for TxEntry
Auto Trait Implementations
impl RefUnwindSafe for TxEntry
impl Send for TxEntry
impl Sync for TxEntry
impl Unpin for TxEntry
impl UnwindSafe for TxEntry
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more