pub struct MiningManagerProxy { /* private fields */ }Expand description
Async proxy for the mining manager
Implementations§
Source§impl MiningManagerProxy
impl MiningManagerProxy
pub fn new(inner: Arc<MiningManager>) -> Self
pub async fn get_block_template( self, consensus: &ConsensusProxy, miner_data: MinerData, ) -> MiningManagerResult<BlockTemplate>
Sourcepub async fn get_realtime_feerate_estimations(self) -> FeerateEstimations
pub async fn get_realtime_feerate_estimations(self) -> FeerateEstimations
Returns realtime feerate estimations based on internal mempool state
Sourcepub async fn get_realtime_feerate_estimations_verbose(
self,
consensus: &ConsensusProxy,
prefix: Prefix,
) -> MiningManagerResult<FeeEstimateVerbose>
pub async fn get_realtime_feerate_estimations_verbose( self, consensus: &ConsensusProxy, prefix: Prefix, ) -> MiningManagerResult<FeeEstimateVerbose>
Returns realtime feerate estimations based on internal mempool state with additional verbose data
Sourcepub async fn validate_and_insert_transaction(
self,
consensus: &ConsensusProxy,
transaction: Transaction,
priority: Priority,
orphan: Orphan,
rbf_policy: RbfPolicy,
) -> MiningManagerResult<TransactionInsertion>
pub async fn validate_and_insert_transaction( self, consensus: &ConsensusProxy, transaction: Transaction, priority: Priority, orphan: Orphan, rbf_policy: RbfPolicy, ) -> MiningManagerResult<TransactionInsertion>
Validates a transaction and adds it to the set of known transactions that have not yet been added to any block.
The validation is constrained by a Replace by fee policy applied
to double spends in the mempool. For more information, see RbfPolicy.
The returned transactions are references of objects owned by the mempool.
Sourcepub async fn validate_and_insert_transaction_batch(
self,
consensus: &ConsensusProxy,
transactions: Vec<Transaction>,
priority: Priority,
orphan: Orphan,
rbf_policy: RbfPolicy,
) -> Vec<MiningManagerResult<Arc<Transaction>>> ⓘ
pub async fn validate_and_insert_transaction_batch( self, consensus: &ConsensusProxy, transactions: Vec<Transaction>, priority: Priority, orphan: Orphan, rbf_policy: RbfPolicy, ) -> Vec<MiningManagerResult<Arc<Transaction>>> ⓘ
Validates a batch of transactions, handling iteratively only the independent ones, and adds those to the set of known transactions that have not yet been added to any block.
The validation is constrained by a Replace by fee policy applied
to double spends in the mempool. For more information, see RbfPolicy.
Returns transactions that where unorphaned following the insertion of the provided transactions. The returned transactions are references of objects owned by the mempool.
pub async fn handle_new_block_transactions( self, consensus: &ConsensusProxy, block_daa_score: u64, block_transactions: Arc<Vec<Transaction>>, ) -> MiningManagerResult<Vec<Arc<Transaction>>>
pub async fn expire_low_priority_transactions(self, consensus: &ConsensusProxy)
pub async fn revalidate_high_priority_transactions( self, consensus: &ConsensusProxy, transaction_ids_sender: UnboundedSender<Vec<TransactionId>>, )
Sourcepub async fn get_transaction(
self,
transaction_id: TransactionId,
query: TransactionQuery,
) -> Option<MutableTransaction>
pub async fn get_transaction( self, transaction_id: TransactionId, query: TransactionQuery, ) -> Option<MutableTransaction>
Try to return a mempool transaction by its id.
Note: the transaction is an orphan if tx.is_fully_populated() returns false.
Sourcepub async fn has_transaction(
self,
transaction_id: TransactionId,
query: TransactionQuery,
) -> bool
pub async fn has_transaction( self, transaction_id: TransactionId, query: TransactionQuery, ) -> bool
Returns whether the mempool holds this transaction in any form.
pub async fn transaction_count(self, query: TransactionQuery) -> usize
pub async fn get_all_transactions( self, query: TransactionQuery, ) -> (Vec<MutableTransaction>, Vec<MutableTransaction>)
Sourcepub async fn get_transactions_by_addresses(
self,
script_public_keys: ScriptPublicKeySet,
query: TransactionQuery,
) -> GroupedOwnerTransactions
pub async fn get_transactions_by_addresses( self, script_public_keys: ScriptPublicKeySet, query: TransactionQuery, ) -> GroupedOwnerTransactions
get_transactions_by_addresses returns the sending and receiving transactions for a set of addresses.
Note: a transaction is an orphan if tx.is_fully_populated() returns false.
Sourcepub async fn has_accepted_transaction(
self,
transaction_id: TransactionId,
) -> bool
pub async fn has_accepted_transaction( self, transaction_id: TransactionId, ) -> bool
Returns whether a transaction id was registered as accepted in the mempool, meaning that the consensus accepted a block containing it and said block was handled by the mempool.
Registered transaction ids expire after a delay and are unregistered from the mempool. So a returned value of true means with certitude that the transaction was accepted and a false means either the transaction was never accepted or it was but beyond the expiration delay.
Sourcepub async fn unaccepted_transactions(
self,
transactions: Vec<TransactionId>,
) -> Vec<TransactionId> ⓘ
pub async fn unaccepted_transactions( self, transactions: Vec<TransactionId>, ) -> Vec<TransactionId> ⓘ
Returns a vector of unaccepted transactions.
For more details, see Self::has_accepted_transaction().
Sourcepub async fn unknown_transactions(
self,
transactions: Vec<TransactionId>,
) -> Vec<TransactionId> ⓘ
pub async fn unknown_transactions( self, transactions: Vec<TransactionId>, ) -> Vec<TransactionId> ⓘ
Returns a vector with all transaction ids that are neither in the mempool, nor in the orphan pool nor accepted.
pub fn snapshot(&self) -> MempoolCountersSnapshot
pub fn p2p_tx_count_sample(&self) -> P2pTxCountSample
Sourcepub fn transaction_count_sample(&self, query: TransactionQuery) -> u64
pub fn transaction_count_sample(&self, query: TransactionQuery) -> u64
Returns a recent sample of transaction count which is not necessarily accurate but is updated enough for being used as a stats/metric
Trait Implementations§
Source§impl Clone for MiningManagerProxy
impl Clone for MiningManagerProxy
Source§fn clone(&self) -> MiningManagerProxy
fn clone(&self) -> MiningManagerProxy
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MiningManagerProxy
impl !RefUnwindSafe for MiningManagerProxy
impl Send for MiningManagerProxy
impl Sync for MiningManagerProxy
impl Unpin for MiningManagerProxy
impl !UnwindSafe for MiningManagerProxy
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<S> CastArc for Swhere
S: CastFromSync + ?Sized,
impl<S> CastArc for Swhere
S: CastFromSync + ?Sized,
Source§impl<T> CastFrom for Twhere
T: Any + 'static,
impl<T> CastFrom for Twhere
T: Any + 'static,
Source§fn ref_any(&self) -> &(dyn Any + 'static)
fn ref_any(&self) -> &(dyn Any + 'static)
Any, which is backed by the type implementing this trait.Source§fn mut_any(&mut self) -> &mut (dyn Any + 'static)
fn mut_any(&mut self) -> &mut (dyn Any + 'static)
Any, which is backed by the type implementing this trait.Source§impl<T> CastFromSync for T
impl<T> CastFromSync 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<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