Minor tweaks

This commit is contained in:
arkpar 2016-12-15 21:44:31 +01:00
parent e1dd986c41
commit 060cc799a6
2 changed files with 5 additions and 7 deletions

View File

@ -978,7 +978,7 @@ impl TransactionQueue {
}
fn collect_pending_transaction<F>(&self, best_block: BlockNumber, mut f: F)
fn filter_pending_transaction<F>(&self, best_block: BlockNumber, mut f: F)
where F: FnMut(&VerifiedTransaction) {
let mut delayed = HashSet::new();
@ -999,14 +999,14 @@ impl TransactionQueue {
/// Returns top transactions from the queue ordered by priority.
pub fn top_transactions_at(&self, best_block: BlockNumber) -> Vec<SignedTransaction> {
let mut r = Vec::new();
self.collect_pending_transaction(best_block, |tx| r.push(tx.transaction.clone()));
self.filter_pending_transaction(best_block, |tx| r.push(tx.transaction.clone()));
r
}
/// Return all ready transactions.
pub fn pending_transactions(&self, best_block: BlockNumber) -> Vec<PendingTransaction> {
let mut r = Vec::new();
self.collect_pending_transaction(best_block, |tx| r.push(PendingTransaction::new(tx.transaction.clone(), tx.min_block)));
self.filter_pending_transaction(best_block, |tx| r.push(PendingTransaction::new(tx.transaction.clone(), tx.min_block)));
r
}

View File

@ -1,7 +1,5 @@
use client::{Rpc, RpcError};
use rpc::v1::types::{ConfirmationRequest,
TransactionModification,
U256};
use rpc::v1::types::{ConfirmationRequest, TransactionModification, U256, BlockNumber};
use serde_json::{Value as JsonValue, to_value};
use std::path::PathBuf;
use futures::{BoxFuture, Canceled};
@ -24,7 +22,7 @@ impl SignerRpc {
id: U256,
new_gas: Option<U256>,
new_gas_price: Option<U256>,
new_min_block: Option<Option<u64>>,
new_min_block: Option<Option<BlockNumber>>,
pwd: &str
) -> BoxFuture<Result<U256, RpcError>, Canceled>
{