Returning number of transactions pending in block not queue

This commit is contained in:
Tomasz Drwięga
2016-03-17 11:19:12 +01:00
parent ecfcc4f3b6
commit 884f2dd873
5 changed files with 28 additions and 4 deletions

View File

@@ -236,7 +236,7 @@ impl<C, S, A, M, EM> Eth for EthClient<C, S, A, M, EM>
fn block_transaction_count_by_number(&self, params: Params) -> Result<Value, Error> {
from_params::<(BlockNumber,)>(params)
.and_then(|(block_number,)| match block_number {
BlockNumber::Pending => to_value(&U256::from(take_weak!(self.miner).status().transaction_queue_pending)),
BlockNumber::Pending => to_value(&U256::from(take_weak!(self.miner).status().block_pending)),
_ => to_value(&take_weak!(self.client).block(block_number.into())
.map_or_else(U256::zero, |bytes| U256::from(BlockView::new(&bytes).transactions_count())))
})