crate::ix!();
pub struct LockPoints {
height: i32,
time: i64,
max_input_block: *mut BlockIndex, }
pub struct TxMemPoolEntry {
tx: TransactionRef,
parents: RefCell<TxMemPoolEntryParents>,
children: RefCell<TxMemPoolEntryChildren>,
n_fee: Amount,
n_tx_weight: usize,
n_usage_size: usize,
n_time: OffsetDateTime,
entry_height: u32,
spends_coinbase: bool,
sig_op_cost: i64,
fee_delta: i64,
lock_points: LockPoints,
n_count_with_descendants: u64,
n_size_with_descendants: u64,
n_mod_fees_with_descendants: Amount,
n_count_with_ancestors: u64, n_size_with_ancestors: u64,
n_mod_fees_with_ancestors: Amount,
n_sig_op_cost_with_ancestors: i64,
tx_hashes_idx: RefCell<usize>,
epoch_marker: RefCell<EpochMarker>,
}
pub type TxMemPoolEntryRef = Amo<TxMemPoolEntry>;
pub type TxMemPoolEntryParents = HashSet<TxMemPoolEntryRef,CompareIteratorByHash>;
pub type TxMemPoolEntryChildren = HashSet<TxMemPoolEntryRef,CompareIteratorByHash>;
impl TxMemPoolEntry {
pub fn get_tx(&self) -> TransactionRef {
self.tx.clone()
}
pub fn get_fee(&self) -> &Amount {
&self.n_fee
}
pub fn get_tx_weight(&self) -> usize {
self.n_tx_weight
}
pub fn get_time(&self) -> OffsetDateTime {
self.n_time
}
pub fn get_height(&self) -> u32 {
self.entry_height
}
pub fn get_sig_op_cost(&self) -> i64 {
self.sig_op_cost
}
pub fn get_modified_fee(&self) -> i64 {
self.n_fee + self.fee_delta
}
pub fn dynamic_memory_usage(&self) -> usize {
self.n_usage_size
}
pub fn get_lock_points(&self) -> &LockPoints {
&self.lock_points
}
pub fn get_count_with_descendants(&self) -> u64 {
self.n_count_with_descendants
}
pub fn get_size_with_descendants(&self) -> u64 {
self.n_size_with_descendants
}
pub fn get_mod_fees_with_descendants(&self) -> Amount {
self.n_mod_fees_with_descendants
}
pub fn get_spends_coinbase(&self) -> bool {
self.spends_coinbase
}
pub fn get_count_with_ancestors(&self) -> u64 {
self.n_count_with_ancestors
}
pub fn get_size_with_ancestors(&self) -> u64 {
self.n_size_with_ancestors
}
pub fn get_mod_fees_with_ancestors(&self) -> Amount {
self.n_mod_fees_with_ancestors
}
pub fn get_sig_op_cost_with_ancestors(&self) -> i64 {
self.n_sig_op_cost_with_ancestors
}
pub fn get_mem_pool_parents_const(&self) -> &TxMemPoolEntryParents {
todo!();
}
pub fn get_mem_pool_children_const(&self) -> &TxMemPoolEntryChildren {
todo!();
}
pub fn get_mem_pool_parents(&self) -> &mut TxMemPoolEntryParents {
todo!();
}
pub fn get_mem_pool_children(&self) -> &mut TxMemPoolEntryChildren {
todo!();
}
pub fn update_descendant_state(&mut self,
modify_size: i64,
modify_fee: Amount,
modify_count: i64) {
todo!();
}
pub fn update_ancestor_state(&mut self,
modify_size: i64,
modify_fee: Amount,
modify_count: i64,
modify_sig_ops: i64) {
todo!();
}
pub fn new(
tx: &TransactionRef,
fee: Amount,
time: i64,
entry_height: u32,
spends_coinbase: bool,
sigops_cost: i64,
lp: LockPoints) -> Self {
todo!();
}
pub fn update_fee_delta(&mut self, new_fee_delta: i64) {
todo!();
}
pub fn update_lock_points(&mut self, lp: LockPoints) {
self.lock_points = lp;
}
pub fn get_tx_size(&self) -> usize {
get_virtual_transaction_size(
self.n_tx_weight.try_into().unwrap(),
self.sig_op_cost
).try_into().unwrap()
}
}
#[inline] pub fn get_virtual_transaction_size(
weight: i64,
sigop_cost: i64) -> i64 {
todo!();
}