Struct ckb_tx_pool::TxEntry
source · pub struct TxEntry {Show 14 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 direct_ancestors_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
direct_ancestors_count: usizedicrect ancestors 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 PartialEq for TxEntry
impl PartialEq for TxEntry
source§impl PartialOrd for TxEntry
impl PartialOrd for TxEntry
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more