[−][src]Struct miner::MemoryPool
Transactions memory pool
Methods
impl MemoryPool
[src]
impl MemoryPool
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates new memory pool
pub fn insert_verified(&mut self, t: IndexedTransaction)
[src]
pub fn insert_verified(&mut self, t: IndexedTransaction)
Insert verified transaction to the MemoryPool
pub fn iter(&self, strategy: OrderingStrategy) -> MemoryPoolIterator
[src]
pub fn iter(&self, strategy: OrderingStrategy) -> MemoryPoolIterator
Iterator over memory pool transactions according to specified strategy
pub fn remove_by_hash(&mut self, h: &H256) -> Option<Transaction>
[src]
pub fn remove_by_hash(&mut self, h: &H256) -> Option<Transaction>
Removes single transaction by its hash. All descedants remain in the pool.
pub fn check_double_spend(
&self,
transaction: &Transaction
) -> DoubleSpendCheckResult
[src]
pub fn check_double_spend(
&self,
transaction: &Transaction
) -> DoubleSpendCheckResult
Checks if transaction
spends some outputs, already spent by inpool transactions.
pub fn remove_by_prevout(
&mut self,
prevout: &OutPoint
) -> Option<Vec<IndexedTransaction>>
[src]
pub fn remove_by_prevout(
&mut self,
prevout: &OutPoint
) -> Option<Vec<IndexedTransaction>>
Removes transaction (and all its descendants) which has spent given output
pub fn read_by_hash(&self, h: &H256) -> Option<&Transaction>
[src]
pub fn read_by_hash(&self, h: &H256) -> Option<&Transaction>
Reads single transaction by its hash.
pub fn read_with_strategy(&mut self, strategy: OrderingStrategy) -> Option<H256>
[src]
pub fn read_with_strategy(&mut self, strategy: OrderingStrategy) -> Option<H256>
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]
pub fn read_n_with_strategy(
&mut self,
n: usize,
strategy: OrderingStrategy
) -> Vec<H256>
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]
pub fn remove_with_strategy(
&mut self,
strategy: OrderingStrategy
) -> Option<IndexedTransaction>
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]
pub fn remove_n_with_strategy(
&mut self,
n: usize,
strategy: OrderingStrategy
) -> Vec<IndexedTransaction>
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]
pub fn set_virtual_fee(&mut self, h: &H256, virtual_fee: i64)
Set miner virtual fee for transaction
pub fn get(&self, hash: &H256) -> Option<&Transaction>
[src]
pub fn get(&self, hash: &H256) -> Option<&Transaction>
Get transaction by hash
pub fn contains(&self, hash: &H256) -> bool
[src]
pub fn contains(&self, hash: &H256) -> bool
Checks if transaction is in the mempool
pub fn information(&self) -> Information
[src]
pub fn information(&self) -> Information
Returns information on MemoryPool
(as in GetMemPoolInfo RPC)
https://bitcoin.org/en/developer-reference#getmempoolinfo
pub fn get_transactions_ids(&self) -> Vec<H256>
[src]
pub fn get_transactions_ids(&self) -> Vec<H256>
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]
pub fn is_spent(&self, prevout: &OutPoint) -> bool
Returns true if output was spent
Trait Implementations
impl Debug for MemoryPool
[src]
impl Debug for MemoryPool
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for MemoryPool
[src]
impl Default for MemoryPool
impl TransactionProvider for MemoryPool
[src]
impl TransactionProvider for MemoryPool
fn transaction_bytes(&self, hash: &H256) -> Option<Bytes>
[src]
fn transaction_bytes(&self, hash: &H256) -> Option<Bytes>
Resolves transaction body bytes by transaction hash.
fn transaction(&self, hash: &H256) -> Option<Transaction>
[src]
fn transaction(&self, hash: &H256) -> Option<Transaction>
Resolves serialized transaction info by transaction hash.
fn contains_transaction(&self, hash: &H256) -> bool
fn contains_transaction(&self, hash: &H256) -> bool
Returns true if store contains given transaction.
impl TransactionOutputProvider for MemoryPool
[src]
impl TransactionOutputProvider for MemoryPool
fn transaction_output(
&self,
prevout: &OutPoint,
_transaction_index: usize
) -> Option<TransactionOutput>
[src]
fn transaction_output(
&self,
prevout: &OutPoint,
_transaction_index: usize
) -> Option<TransactionOutput>
Returns transaction output.
fn is_spent(&self, outpoint: &OutPoint) -> bool
[src]
fn is_spent(&self, outpoint: &OutPoint) -> bool
Returns true if we know that output is double spent.
impl HeapSizeOf for MemoryPool
[src]
impl HeapSizeOf for MemoryPool
fn heap_size_of_children(&self) -> usize
[src]
fn heap_size_of_children(&self) -> usize
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 Send for MemoryPool
impl Sync for MemoryPool
impl Sync for MemoryPool
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
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]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 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
impl<T> Erased for T