Struct snarkos_node_consensus::MemoryPool
source · pub struct MemoryPool<N: Network> { /* private fields */ }Implementations§
source§impl<N: Network> MemoryPool<N>
impl<N: Network> MemoryPool<N>
sourcepub fn contains_unconfirmed_solution(
&self,
puzzle_commitment: PuzzleCommitment<N>
) -> bool
pub fn contains_unconfirmed_solution( &self, puzzle_commitment: PuzzleCommitment<N> ) -> bool
Returns true if the given unconfirmed solution exists in the memory pool.
sourcepub fn num_unconfirmed_solutions(&self) -> usize
pub fn num_unconfirmed_solutions(&self) -> usize
Returns the number of unconfirmed solutions in the memory pool.
sourcepub fn unconfirmed_solutions(&self) -> Vec<(ProverSolution<N>, u64)>
pub fn unconfirmed_solutions(&self) -> Vec<(ProverSolution<N>, u64)>
Returns the unconfirmed solutions in the memory pool.
sourcepub fn candidate_coinbase_target(
&self,
latest_proof_target: u64
) -> Result<u128>
pub fn candidate_coinbase_target( &self, latest_proof_target: u64 ) -> Result<u128>
Returns the candidate coinbase target of the valid unconfirmed solutions in the memory pool.
sourcepub fn candidate_solutions<C: ConsensusStorage<N>>(
&self,
consensus: &Consensus<N, C>,
latest_height: u32,
latest_proof_target: u64,
latest_coinbase_target: u64
) -> Result<Option<Vec<ProverSolution<N>>>>
pub fn candidate_solutions<C: ConsensusStorage<N>>( &self, consensus: &Consensus<N, C>, latest_height: u32, latest_proof_target: u64, latest_coinbase_target: u64 ) -> Result<Option<Vec<ProverSolution<N>>>>
Returns a candidate set of unconfirmed solutions for inclusion in a block.
sourcepub fn add_unconfirmed_solution(
&self,
solution: &ProverSolution<N>
) -> Result<bool>
pub fn add_unconfirmed_solution( &self, solution: &ProverSolution<N> ) -> Result<bool>
Adds the given unconfirmed solution to the memory pool.
sourcepub fn clear_invalid_solutions<C: ConsensusStorage<N>>(
&self,
consensus: &Consensus<N, C>
)
pub fn clear_invalid_solutions<C: ConsensusStorage<N>>( &self, consensus: &Consensus<N, C> )
Clears the memory pool of unconfirmed transactions that are now invalid.
sourcepub fn clear_all_unconfirmed_solutions(&self)
pub fn clear_all_unconfirmed_solutions(&self)
Clears all unconfirmed solutions from the memory pool.
source§impl<N: Network> MemoryPool<N>
impl<N: Network> MemoryPool<N>
sourcepub fn contains_unconfirmed_transaction(
&self,
transaction_id: N::TransactionID
) -> bool
pub fn contains_unconfirmed_transaction( &self, transaction_id: N::TransactionID ) -> bool
Returns true if the given unconfirmed transaction exists in the memory pool.
sourcepub fn num_unconfirmed_transactions(&self) -> usize
pub fn num_unconfirmed_transactions(&self) -> usize
Returns the number of unconfirmed transactions in the memory pool.
sourcepub fn unconfirmed_transactions(&self) -> Vec<Transaction<N>>
pub fn unconfirmed_transactions(&self) -> Vec<Transaction<N>>
Returns the unconfirmed transactions in the memory pool.
sourcepub fn candidate_transactions<C: ConsensusStorage<N>>(
&self,
consensus: &Consensus<N, C>
) -> Vec<Transaction<N>>
pub fn candidate_transactions<C: ConsensusStorage<N>>( &self, consensus: &Consensus<N, C> ) -> Vec<Transaction<N>>
Returns a candidate set of unconfirmed transactions for inclusion in a block.
sourcepub fn add_unconfirmed_transaction(&self, transaction: &Transaction<N>) -> bool
pub fn add_unconfirmed_transaction(&self, transaction: &Transaction<N>) -> bool
Adds the given unconfirmed transaction to the memory pool.
sourcepub fn clear_invalid_transactions<C: ConsensusStorage<N>>(
&self,
consensus: &Consensus<N, C>
)
pub fn clear_invalid_transactions<C: ConsensusStorage<N>>( &self, consensus: &Consensus<N, C> )
Clears the memory pool of unconfirmed transactions that are now invalid.
sourcepub fn clear_unconfirmed_transactions(&self)
pub fn clear_unconfirmed_transactions(&self)
Clears the memory pool of all unconfirmed transactions.
source§impl<N: Network> MemoryPool<N>
impl<N: Network> MemoryPool<N>
Trait Implementations§
source§impl<N: Clone + Network> Clone for MemoryPool<N>where
N::TransactionID: Clone,
impl<N: Clone + Network> Clone for MemoryPool<N>where N::TransactionID: Clone,
source§fn clone(&self) -> MemoryPool<N>
fn clone(&self) -> MemoryPool<N>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more