[−][src]Struct grin_pool::Pool
Fields
entries: Vec<PoolEntry>
Entries in the pool (tx + info + timer) in simple insertion order.
blockchain: Arc<dyn BlockChain>
The blockchain
verifier_cache: Arc<RwLock<dyn VerifierCache>>
name: String
Implementations
impl Pool
[src]
pub fn new(
chain: Arc<dyn BlockChain>,
verifier_cache: Arc<RwLock<dyn VerifierCache>>,
name: String
) -> Pool
[src]
chain: Arc<dyn BlockChain>,
verifier_cache: Arc<RwLock<dyn VerifierCache>>,
name: String
) -> Pool
pub fn contains_tx(&self, hash: Hash) -> bool
[src]
Does the transaction pool contain an entry for the given transaction?
pub fn get_tx(&self, hash: Hash) -> Option<Transaction>
[src]
pub fn retrieve_tx_by_kernel_hash(&self, hash: Hash) -> Option<Transaction>
[src]
Query the tx pool for an individual tx matching the given kernel hash.
pub fn retrieve_transactions(
&self,
hash: Hash,
nonce: u64,
kern_ids: &[ShortId]
) -> (Vec<Transaction>, Vec<ShortId>)
[src]
&self,
hash: Hash,
nonce: u64,
kern_ids: &[ShortId]
) -> (Vec<Transaction>, Vec<ShortId>)
Query the tx pool for all known txs based on kernel short_ids from the provided compact_block. Note: does not validate that we return the full set of required txs. The caller will need to validate that themselves.
pub fn prepare_mineable_transactions(
&self,
max_weight: usize
) -> Result<Vec<Transaction>, PoolError>
[src]
&self,
max_weight: usize
) -> Result<Vec<Transaction>, PoolError>
Take pool transactions, filtering and ordering them in a way that's appropriate to put in a mined block. Aggregates chains of dependent transactions, orders by fee over weight and ensures the total weight does not exceed the provided max_weight (miner defined block weight).
pub fn all_transactions(&self) -> Vec<Transaction>
[src]
pub fn all_transactions_aggregate(
&self
) -> Result<Option<Transaction>, PoolError>
[src]
&self
) -> Result<Option<Transaction>, PoolError>
Return a single aggregate tx representing all txs in the txpool. Returns None if the txpool is empty.
pub fn add_to_pool(
&mut self,
entry: PoolEntry,
extra_txs: Vec<Transaction>,
header: &BlockHeader
) -> Result<(), PoolError>
[src]
&mut self,
entry: PoolEntry,
extra_txs: Vec<Transaction>,
header: &BlockHeader
) -> Result<(), PoolError>
pub fn validate_raw_txs(
&self,
txs: &[Transaction],
extra_tx: Option<Transaction>,
header: &BlockHeader,
weighting: Weighting
) -> Result<Vec<Transaction>, PoolError>
[src]
&self,
txs: &[Transaction],
extra_tx: Option<Transaction>,
header: &BlockHeader,
weighting: Weighting
) -> Result<Vec<Transaction>, PoolError>
pub fn reconcile(
&mut self,
extra_tx: Option<Transaction>,
header: &BlockHeader
) -> Result<(), PoolError>
[src]
&mut self,
extra_tx: Option<Transaction>,
header: &BlockHeader
) -> Result<(), PoolError>
pub fn bucket_transactions(&self, weighting: Weighting) -> Vec<Transaction>
[src]
Buckets consist of a vec of txs and track the aggregate fee_to_weight. We aggregate (cut-through) dependent transactions within a bucket unless adding a tx would reduce the aggregate fee_to_weight, in which case we start a new bucket. Note this new bucket will by definition have a lower fee_to_weight than the bucket containing the tx it depends on. Sorting the buckets by fee_to_weight will therefore preserve dependency ordering, maximizing both cut-through and overall fees.
pub fn find_matching_transactions(
&self,
kernels: &[TxKernel]
) -> Vec<Transaction>
[src]
&self,
kernels: &[TxKernel]
) -> Vec<Transaction>
pub fn reconcile_block(&mut self, block: &Block)
[src]
Quick reconciliation step - we can evict any txs in the pool where inputs or kernels intersect with the block.
pub fn size(&self) -> usize
[src]
Size of the pool.
pub fn kernel_count(&self) -> usize
[src]
Number of transaction kernels in the pool. This may differ from the size (number of transactions) due to tx aggregation.
pub fn is_empty(&self) -> bool
[src]
Is the pool empty?
Auto Trait Implementations
impl !RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl !UnwindSafe for Pool
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,