Returning number of transactions pending in block not queue
This commit is contained in:
@@ -108,4 +108,6 @@ pub struct MinerStatus {
|
||||
pub transaction_queue_pending: usize,
|
||||
/// Number of transactions in queue with state `future` (not yet ready to be included in block)
|
||||
pub transaction_queue_future: usize,
|
||||
/// Number of transactions included in currently mined block
|
||||
pub block_pending: usize,
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ use std::sync::atomic::AtomicBool;
|
||||
use util::{H256, U256, Address, Bytes, Uint};
|
||||
use ethcore::views::{BlockView};
|
||||
use ethcore::client::{BlockChainClient, BlockId};
|
||||
use ethcore::block::{ClosedBlock};
|
||||
use ethcore::block::{ClosedBlock, IsBlock};
|
||||
use ethcore::error::{Error};
|
||||
use ethcore::transaction::SignedTransaction;
|
||||
use super::{MinerService, MinerStatus, TransactionQueue};
|
||||
@@ -104,9 +104,11 @@ impl MinerService for Miner {
|
||||
|
||||
fn status(&self) -> MinerStatus {
|
||||
let status = self.transaction_queue.lock().unwrap().status();
|
||||
let block = self.sealing_block.lock().unwrap();
|
||||
MinerStatus {
|
||||
transaction_queue_pending: status.pending,
|
||||
transaction_queue_future: status.future,
|
||||
block_pending: block.as_ref().map_or(0, |b| b.transactions().len()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user