RPC: parity_allTransactionHashes (#9745)

* rpc: add parity_allTransactionHashes

* Add light_all_transactionst to helpers

* Remove extra parentheses

* Move light_all_transactions to light_fetch

* Remove LightDispatcher import in light_fetch
This commit is contained in:
Kirill Fomichev
2018-10-27 10:38:35 +03:00
committed by Niklas Adolfsson
parent 6643b6a306
commit f8f8bf0fea
9 changed files with 53 additions and 12 deletions

View File

@@ -315,6 +315,12 @@ impl TransactionQueue {
self.pool.read().unordered_pending(ready).collect()
}
/// Returns all transaction hashes in the queue without explicit ordering.
pub fn all_transaction_hashes(&self) -> Vec<H256> {
let ready = |_tx: &pool::VerifiedTransaction| txpool::Readiness::Ready;
self.pool.read().unordered_pending(ready).map(|tx| tx.hash).collect()
}
/// Computes unordered set of pending hashes.
///
/// Since strict nonce-checking is not required, you may get some false positive future transactions as well.