crate::ix!();
pub const MEMPOOL_HEIGHT: u32 = 0x7FFFFFFF;
pub struct DescendantScore {}
pub struct EntryTime {}
pub struct AncestorScore {}
pub struct IndexByWTxid {}
pub struct TxIdIndex {}
pub struct InsertionOrder {}
pub struct TxMemPool {
pub check_ratio: i32,
pub n_transactions_updated: AtomicU32,
pub miner_policy_estimator: Arc<BlockPolicyEstimator>,
pub cs: Arc<Mutex<TxMemPoolInner>>,
}
pub struct TxMemPoolInner {
pub total_tx_size: u64,
pub total_fee: Amount,
pub cached_inner_usage: u64,
pub last_rolling_fee_update: Arc<Mutex<i64>>,
pub block_since_last_rolling_fee_bump: AtomicBool,
pub rolling_minimum_fee_rate: AtomicF64,
pub epoch: Arc<Mutex<Epoch>>,
pub sequence_number: RefCell<u64>,
pub is_loaded: bool,
pub map_tx: TxMemPoolIndexedTransactionSet,
pub tx_hashes: Vec<(u256,TxMemPoolTxIter)>,
pub unbroadcast_txids: HashSet<u256>,
pub map_next_tx: IndirectMap<OutPoint,Arc<Transaction>>,
pub map_deltas: HashMap<u256,Amount>,
}
pub type TxMemPoolSetEntries = HashSet<TxMemPoolTxIter,CompareIteratorByHash>;
pub type TxMemPoolIndexedTransactionSetNthIndex0ConstIterator = Broken;
pub type TxMemPoolTxIter = TxMemPoolIndexedTransactionSetNthIndex0ConstIterator;
pub type TxMemPoolCacheMap = HashMap<TxMemPoolTxIter,TxMemPoolSetEntries,CompareIteratorByHash>;
pub const ROLLING_FEE_HALFLIFE: i32 = 60 * 60 * 12;
pub type TxMemPoolIndexedTransactionSet = Broken;
pub type TxMemPoolIndexedTransactionSetConstIterator = Broken;
pub type TxMemPoolIndexedTransactionSetIterator = Broken;
multidex!{
name => TxMemPoolIndexedTransactionSet,
item => TxMemPoolEntry,
hashed_unique => [
(IndexByTxid, MempoolEntryTxId, SaltedTxidHasher),
(IndexByWtxId, MempoolEntryWTxId, SaltedTxidHasher)
]
ordered_nonunique => [
(DescendantScore, TxMemPoolEntry, CompareTxMemPoolEntryByDescendantScore),
(EntryTime, TxMemPoolEntry, CompareTxMemPoolEntryByEntryTime),
(AncestorScore, TxMemPoolEntry, CompareTxMemPoolEntryByAncestorFee)
]
}
pub trait ITxMemPool {}
impl ITxMemPool for TxMemPool {}
impl TxMemPool {
pub fn size(&self) -> u64 {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_total_tx_size(&self) -> u64 {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_total_fee(&self) -> Amount {
todo!();
}
pub fn exists(&self, gtxid: &GenTxId) -> bool {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_iter_from_wtxid(&self, wtxid: &u256) -> TxMemPoolTxIter {
todo!();
}
pub fn add_unbroadcast_tx(&mut self, txid: &u256) {
todo!();
}
pub fn get_unbroadcast_txs(&self) -> HashSet<u256> {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn is_unbroadcast_tx(&self, txid: &u256) -> bool {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_and_increment_sequence(&self) -> u64 {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_sequence(&self) -> u64 {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs, m_epoch)]
fn visited_impl(&self, it: TxMemPoolTxIter) -> bool {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs, m_epoch)]
pub fn visited(&self, it: Option<TxMemPoolTxIter>) -> bool {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn update_for_descendants(&mut self,
update_it: TxMemPoolTxIter,
cached_descendants: &mut TxMemPoolCacheMap,
set_exclude: &HashSet<u256>) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main)]
#[LOCKS_EXCLUDED(m_epoch)]
pub fn update_transactions_from_block(&mut self, hashes_to_update: &Vec<u256>) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn calculate_ancestors_and_check_limits(&self,
entry_size: usize,
entry_count: usize,
set_ancestors: &mut TxMemPoolSetEntries,
staged_ancestors: &mut TxMemPoolEntryParents,
limit_ancestor_count: u64,
limit_ancestor_size: u64,
limit_descendant_count: u64,
limit_descendant_size: u64,
err_string: &mut String) -> bool {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn check_package_limits(&self,
package: &Package,
limit_ancestor_count: u64,
limit_ancestor_size: u64,
limit_descendant_count: u64,
limit_descendant_size: u64,
err_string: &mut String) -> bool {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn calculate_mem_pool_ancestors(&self,
entry: &TxMemPoolEntry,
set_ancestors: &mut TxMemPoolSetEntries,
limit_ancestor_count: u64,
limit_ancestor_size: u64,
limit_descendant_count: u64,
limit_descendant_size: u64,
err_string: &mut String,
search_for_parents: Option<bool>) -> bool {
let search_for_parents: bool = search_for_parents.unwrap_or(true);
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn update_ancestors_of(&mut self,
add: bool,
it: TxMemPoolTxIter,
set_ancestors: &mut TxMemPoolSetEntries) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn update_entry_for_ancestors(&mut self,
it: TxMemPoolTxIter,
set_ancestors: &TxMemPoolSetEntries) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn update_children_for_removal(&mut self, it: TxMemPoolTxIter) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn update_for_remove_from_mempool(&mut self,
entries_to_remove: &TxMemPoolSetEntries,
update_descendants: bool) {
todo!();
}
pub fn new(
estimator: *mut BlockPolicyEstimator,
check_ratio: Option<i32>) -> Self {
let check_ratio: i32 = check_ratio.unwrap_or(0);
todo!();
}
pub fn is_spent(&self, outpoint: &OutPoint) -> bool {
todo!();
}
pub fn get_transactions_updated(&self) -> u32 {
todo!();
}
pub fn add_transactions_updated(&mut self, n: u32) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main)]
pub fn add_unchecked_with_set_ancestors(&mut self,
entry: &TxMemPoolEntry,
set_ancestors: &mut TxMemPoolSetEntries,
valid_fee_estimate: Option<bool>) {
let valid_fee_estimate: bool = valid_fee_estimate.unwrap_or(true);
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn remove_unchecked(&mut self,
it: TxMemPoolTxIter,
reason: MemPoolRemovalReason) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn calculate_descendants(&self,
entryit: TxMemPoolTxIter,
set_descendants: &mut TxMemPoolSetEntries) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn remove_recursive(&mut self,
orig_tx: &Transaction,
reason: MemPoolRemovalReason) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn remove_conflicts(&mut self, tx: &Transaction) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn remove_for_block(&mut self,
vtx: &Vec<TransactionRef>,
n_block_height: u32) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
fn clear_impl(&mut self) {
todo!();
}
pub fn clear(&mut self) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(::cs_main)]
pub fn check(&self,
active_coins_tip: &CoinsViewCache,
spendheight: i64)
{
todo!();
}
pub fn compare_depth_and_score(&mut self,
hasha: &u256,
hashb: &u256,
wtxid: Option<bool>) -> bool {
let wtxid: bool = wtxid.unwrap_or(false);
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_sorted_depth_and_score(&self) -> Vec<TxMemPoolIndexedTransactionSetConstIterator> {
todo!();
}
pub fn query_hashes(&self, vtxid: &mut Vec<u256>) {
todo!();
}
pub fn info_all(&self) -> Vec<TxMemPoolInfo> {
todo!();
}
pub fn get(&self, hash: &u256) -> TransactionRef {
todo!();
}
pub fn info(&self, gtxid: &GenTxId) -> TxMemPoolInfo {
todo!();
}
pub fn prioritise_transaction(&mut self,
hash: &u256,
n_fee_delta: &Amount) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn apply_delta(&self,
hash: &u256,
n_fee_delta: &mut Amount) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn clear_prioritisation(&mut self, hash: &u256) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_conflict_tx(&self, prevout: &OutPoint) -> Arc<Transaction> {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_iter(&self, txid: &u256) -> Option<TxMemPoolTxIter> {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn get_iter_set(&self, hashes: &HashSet<u256>) -> TxMemPoolSetEntries {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn has_no_inputs_of(&self, tx: &Transaction) -> bool {
todo!();
}
pub fn dynamic_memory_usage(&self) -> usize {
todo!();
}
pub fn remove_unbroadcast_tx(&mut self,
txid: &u256,
unchecked: Option<bool>) {
let unchecked: bool = unchecked.unwrap_or(false);
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn remove_staged(&mut self,
stage: &mut TxMemPoolSetEntries,
update_descendants: bool,
reason: MemPoolRemovalReason) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn expire(&mut self, time: Instant ) -> i32 {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main)]
pub fn add_unchecked(&mut self,
entry: &TxMemPoolEntry,
valid_fee_estimate: Option<bool>) {
let valid_fee_estimate: bool = valid_fee_estimate.unwrap_or(true);
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn update_child(&mut self,
entry: TxMemPoolTxIter,
child: TxMemPoolTxIter,
add: bool) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn update_parent(&mut self,
entry: TxMemPoolTxIter,
parent: TxMemPoolTxIter,
add: bool) {
todo!();
}
pub fn get_min_fee(&self, sizelimit: usize) -> FeeRate {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn track_package_removed(&mut self, rate: &FeeRate) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn trim_to_size(&mut self,
sizelimit: usize,
pv_no_spends_remaining: Arc<Mutex<Vec<OutPoint>>>) {
todo!();
}
#[EXCLUSIVE_LOCKS_REQUIRED(cs)]
pub fn calculate_descendant_maximum(&self, entry: TxMemPoolTxIter) -> u64 {
todo!();
}
pub fn get_transaction_ancestry(&self,
txid: &u256,
ancestors: &mut usize,
descendants: &mut usize,
ancestorsize: *mut usize,
ancestorfees: *mut Amount) {
todo!();
}
pub fn is_loaded(&self) -> bool {
todo!();
}
pub fn set_is_loaded(&mut self, loaded: bool) {
todo!();
}
}
pub fn get_info(it: TxMemPoolIndexedTransactionSetConstIterator) -> TxMemPoolInfo {
todo!();
}