Struct ethcore_miner::pool::TransactionQueue [−][src]
pub struct TransactionQueue { /* fields omitted */ }
Ethereum Transaction Queue
Responsible for:
- verifying incoming transactions
- maintaining a pool of verified transactions.
- returning an iterator for transactions that are ready to be included in block (pending)
Methods
impl TransactionQueue
[src]
impl TransactionQueue
pub fn new(
limits: Options,
verification_options: Options,
strategy: PrioritizationStrategy
) -> Self
[src]
pub fn new(
limits: Options,
verification_options: Options,
strategy: PrioritizationStrategy
) -> Self
Create new queue with given pool limits and initial verification options.
pub fn set_verifier_options(&self, options: Options)
[src]
pub fn set_verifier_options(&self, options: Options)
Update verification options
Some parameters of verification may vary in time (like block gas limit or minimal gas price).
pub fn import<C: Client>(
&self,
client: C,
transactions: Vec<Transaction>
) -> Vec<Result<(), Error>>
[src]
pub fn import<C: Client>(
&self,
client: C,
transactions: Vec<Transaction>
) -> Vec<Result<(), Error>>
Import a set of transactions to the pool.
Given blockchain and state access (Client) verifies and imports transactions to the pool.
pub fn all_transactions(&self) -> Vec<Arc<VerifiedTransaction>>
[src]
pub fn all_transactions(&self) -> Vec<Arc<VerifiedTransaction>>
Returns all transactions in the queue without explicit ordering.
pub fn pending_hashes<N>(&self, nonce: N) -> BTreeSet<H256> where
N: Fn(&Address) -> Option<U256>,
[src]
pub fn pending_hashes<N>(&self, nonce: N) -> BTreeSet<H256> where
N: Fn(&Address) -> Option<U256>,
Computes unordered set of pending hashes.
Since strict nonce-checking is not required, you may get some false positive future transactions as well.
pub fn pending<C>(
&self,
client: C,
settings: PendingSettings
) -> Vec<Arc<VerifiedTransaction>> where
C: NonceClient,
[src]
pub fn pending<C>(
&self,
client: C,
settings: PendingSettings
) -> Vec<Arc<VerifiedTransaction>> where
C: NonceClient,
Returns current pending transactions ordered by priority.
NOTE: This may return a cached version of pending transaction set.
Re-computing the pending set is possible with #collect_pending
method,
but be aware that it's a pretty expensive operation.
pub fn collect_pending<C, F, T>(
&self,
client: C,
block_number: u64,
current_timestamp: u64,
nonce_cap: Option<U256>,
collect: F
) -> T where
C: NonceClient,
F: FnOnce(PendingIterator<VerifiedTransaction, (Condition, State<C>), NonceAndGasPrice, (LocalTransactionsList, (Notifier, Logger))>) -> T,
[src]
pub fn collect_pending<C, F, T>(
&self,
client: C,
block_number: u64,
current_timestamp: u64,
nonce_cap: Option<U256>,
collect: F
) -> T where
C: NonceClient,
F: FnOnce(PendingIterator<VerifiedTransaction, (Condition, State<C>), NonceAndGasPrice, (LocalTransactionsList, (Notifier, Logger))>) -> T,
Collect pending transactions.
NOTE This is re-computing the pending set and it might be expensive to do so.
Prefer using cached pending set using #pending
method.
pub fn cull<C: NonceClient + Clone>(&self, client: C)
[src]
pub fn cull<C: NonceClient + Clone>(&self, client: C)
Culls all stalled transactions from the pool.
pub fn next_nonce<C: NonceClient>(
&self,
client: C,
address: &Address
) -> Option<U256>
[src]
pub fn next_nonce<C: NonceClient>(
&self,
client: C,
address: &Address
) -> Option<U256>
Returns next valid nonce for given sender
or None
if there are no pending transactions from that sender.
pub fn find(&self, hash: &H256) -> Option<Arc<VerifiedTransaction>>
[src]
pub fn find(&self, hash: &H256) -> Option<Arc<VerifiedTransaction>>
Retrieve a transaction from the pool.
Given transaction hash looks up that transaction in the pool
and returns a shared pointer to it or None
if it's not present.
pub fn remove<'a, T: IntoIterator<Item = &'a H256>>(
&self,
hashes: T,
is_invalid: bool
) -> Vec<Option<Arc<VerifiedTransaction>>>
[src]
pub fn remove<'a, T: IntoIterator<Item = &'a H256>>(
&self,
hashes: T,
is_invalid: bool
) -> Vec<Option<Arc<VerifiedTransaction>>>
Remove a set of transactions from the pool.
Given an iterator of transaction hashes removes them from the pool. That method should be used if invalid transactions are detected or you want to cancel a transaction.
pub fn clear(&self)
[src]
pub fn clear(&self)
Clear the entire pool.
pub fn penalize<'a, T: IntoIterator<Item = &'a Address>>(&self, senders: T)
[src]
pub fn penalize<'a, T: IntoIterator<Item = &'a Address>>(&self, senders: T)
Penalize given senders.
pub fn current_worst_gas_price(&self) -> U256
[src]
pub fn current_worst_gas_price(&self) -> U256
Returns gas price of currently the worst transaction in the pool.
pub fn status(&self) -> Status
[src]
pub fn status(&self) -> Status
Returns a status of the queue.
pub fn has_local_pending_transactions(&self) -> bool
[src]
pub fn has_local_pending_transactions(&self) -> bool
Check if there are any local transactions in the pool.
Returns true
if there are any transactions in the pool
that has been marked as local.
Local transactions are the ones from accounts managed by this node
and transactions submitted via local RPC (eth_sendRawTransaction
)
pub fn local_transactions(&self) -> BTreeMap<H256, Status>
[src]
pub fn local_transactions(&self) -> BTreeMap<H256, Status>
Returns status of recently seen local transactions.
pub fn add_listener(&self, f: Box<Fn(&[H256]) + Send + Sync>)
[src]
pub fn add_listener(&self, f: Box<Fn(&[H256]) + Send + Sync>)
Add a callback to be notified about all transactions entering the pool.
Trait Implementations
impl Debug for TransactionQueue
[src]
impl Debug for TransactionQueue
Auto Trait Implementations
impl Send for TransactionQueue
impl Send for TransactionQueue
impl Sync for TransactionQueue
impl Sync for TransactionQueue