# [−] [src] Struct miner::MemoryPool

    pub struct MemoryPool { /* fields omitted */ }

Transactions memory pool

## Methods

###

`impl MemoryPool`

[src]

####

`pub fn new() -> Self`

[src]

Creates new memory pool

####

`pub fn insert_verified(&mut self, t: IndexedTransaction)`

[src]

Insert verified transaction to the `MemoryPool`

####

`pub fn iter(&self, strategy: OrderingStrategy) -> MemoryPoolIterator`

[src]

Iterator over memory pool transactions according to specified strategy

####

`pub fn remove_by_hash(&mut self, h: &H256) -> Option<Transaction>`

[src]

Removes single transaction by its hash. All descedants remain in the pool.

####

`pub fn check_double_spend( &self, transaction: &Transaction ) -> DoubleSpendCheckResult`

[src]

Checks if `transaction` spends some outputs, already spent by inpool transactions.

####

`pub fn remove_by_prevout( &mut self, prevout: &OutPoint ) -> Option<Vec<IndexedTransaction>>`

[src]

Removes transaction (and all its descendants) which has spent given output

####

`pub fn read_by_hash(&self, h: &H256) -> Option<&Transaction>`

[src]

Reads single transaction by its hash.

####

`pub fn read_with_strategy(&mut self, strategy: OrderingStrategy) -> Option<H256>`

[src]

Reads hash of the 'top' transaction from the `MemoryPool` using selected strategy. Ancestors are always returned before descendant transactions.

####

`pub fn read_n_with_strategy( &mut self, n: usize, strategy: OrderingStrategy ) -> Vec<H256>`

[src]

Reads hashes of up to n transactions from the `MemoryPool`, using selected strategy. Ancestors are always returned before descendant transactions. Use this function with care, only if really needed (heavy memory usage)

####

`pub fn remove_with_strategy( &mut self, strategy: OrderingStrategy ) -> Option<IndexedTransaction>`

[src]

Removes the 'top' transaction from the `MemoryPool` using selected strategy. Ancestors are always removed before descendant transactions.

####

`pub fn remove_n_with_strategy( &mut self, n: usize, strategy: OrderingStrategy ) -> Vec<IndexedTransaction>`

[src]

Removes up to n transactions from the `MemoryPool`, using selected strategy. Ancestors are always removed before descendant transactions.

####

`pub fn set_virtual_fee(&mut self, h: &H256, virtual_fee: i64)`

[src]

Set miner virtual fee for transaction

####

`pub fn get(&self, hash: &H256) -> Option<&Transaction>`

[src]

Get transaction by hash

####

`pub fn contains(&self, hash: &H256) -> bool`

[src]

Checks if transaction is in the mempool

####

`pub fn information(&self) -> Information`

[src]

Returns information on `MemoryPool` (as in GetMemPoolInfo RPC) https://bitcoin.org/en/developer-reference#getmempoolinfo

####

`pub fn get_transactions_ids(&self) -> Vec<H256>`

[src]

Returns TXIDs of all transactions in `MemoryPool` (as in GetRawMemPool RPC) https://bitcoin.org/en/developer-reference#getrawmempool

####

`pub fn is_spent(&self, prevout: &OutPoint) -> bool`

[src]

Returns true if output was spent

## Trait Implementations

###

`impl Debug for MemoryPool`

[src]

####

`fn fmt(&self, f: &mut Formatter) -> Result`

[src]

Formats the value using the given formatter. Read more

###

`impl Default for MemoryPool`

[src]

####

`fn default() -> Self`

[src]

Returns the "default value" for a type. Read more

###

`impl TransactionProvider for MemoryPool`

[src]

####

`fn transaction_bytes(&self, hash: &H256) -> Option<Bytes>`

[src]

Resolves transaction body bytes by transaction hash.

####

`fn transaction(&self, hash: &H256) -> Option<Transaction>`

[src]

Resolves serialized transaction info by transaction hash.

####

`fn contains_transaction(&self, hash: &H256) -> bool` |

Returns true if store contains given transaction.

###

`impl TransactionOutputProvider for MemoryPool`

[src]

####

`fn transaction_output( &self, prevout: &OutPoint, _transaction_index: usize ) -> Option<TransactionOutput>`

[src]

Returns transaction output.

####

`fn is_spent(&self, outpoint: &OutPoint) -> bool`

[src]

Returns true if we know that output is double spent.

###

`impl HeapSizeOf for MemoryPool`

[src]

####

`fn heap_size_of_children(&self) -> usize`

[src]

Measure the size of any heap-allocated structures that hang off this value, but not the space taken up by the value itself (i.e. what size_of:: measures, more or less); that space is handled by the implementation of HeapSizeOf for Box below. Read more

## Auto Trait Implementations

###

`impl Send for MemoryPool`

###

`impl Sync for MemoryPool`

## Blanket Implementations

###

`impl<T> From for T`

[src]

####

`fn from(t: T) -> T`

[src]

Performs the conversion.

###

`impl<T, U> Into for T where U: From<T>,`

[src]

####

`fn into(self) -> U`

[src]

Performs the conversion.

###

`impl<T, U> TryFrom for T where T: From<U>,`

[src]

#### `type Error = !`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> Borrow for T where T: ?Sized,`

[src]

####

`fn borrow(&self) -> &T`

[src]

Immutably borrows from an owned value. Read more

###

`impl<T, U> TryInto for T where U: TryFrom<T>,`

[src]

#### `type Error = <U as TryFrom<T>>::Error`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> BorrowMut for T where T: ?Sized,`

[src]

####

`fn borrow_mut(&mut self) -> &mut T`

[src]

Mutably borrows from an owned value. Read more

###

`impl<T> Any for T where T: 'static + ?Sized,`

[src]

####

`fn get_type_id(&self) -> TypeId`

[src]

🔬 This is a nightly-only experimental API. (`get_type_id`)

this method will likely be replaced by an associated static

Gets the `TypeId` of `self`. Read more

###

`impl<T> Erased for T`

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)