Local transactions RPC

This commit is contained in:
Tomasz Drwięga
2016-11-16 17:54:54 +01:00
parent 66e327dfcb
commit 2cd2b10327
11 changed files with 240 additions and 38 deletions

View File

@@ -86,12 +86,13 @@ use std::ops::Deref;
use std::cmp::Ordering;
use std::cmp;
use std::collections::{HashSet, HashMap, BTreeSet, BTreeMap};
use linked_hash_map::LinkedHashMap;
use util::{Address, H256, Uint, U256};
use util::table::Table;
use transaction::*;
use error::{Error, TransactionError};
use client::TransactionImportResult;
use miner::local_transactions::LocalTransactionsList;
use miner::local_transactions::{LocalTransactionsList, Status as LocalTransactionStatus};
/// Transaction origin
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
@@ -901,6 +902,11 @@ impl TransactionQueue {
.collect()
}
/// Returns local transactions (some of them might not be part of the queue anymore).
pub fn local_transactions(&self) -> &LinkedHashMap<H256, LocalTransactionStatus> {
self.local_transactions.all_transactions()
}
#[cfg(test)]
fn future_transactions(&self) -> Vec<SignedTransaction> {
self.future.by_priority