RPC for number of unconfirmed transactions
This commit is contained in:
@@ -69,6 +69,12 @@ pub trait SigningQueue: Send + Sync {
|
||||
|
||||
/// Return copy of all the requests in the queue.
|
||||
fn requests(&self) -> Vec<TransactionConfirmation>;
|
||||
|
||||
/// Returns number of transactions awaiting confirmation.
|
||||
fn len(&self) -> usize;
|
||||
|
||||
/// Returns true if there are no transactions awaiting confirmation.
|
||||
fn is_empty(&self) -> bool;
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
@@ -277,6 +283,16 @@ impl SigningQueue for ConfirmationsQueue {
|
||||
let queue = self.queue.read().unwrap();
|
||||
queue.values().map(|token| token.request.clone()).collect()
|
||||
}
|
||||
|
||||
fn len(&self) -> usize {
|
||||
let queue = self.queue.read().unwrap();
|
||||
queue.len()
|
||||
}
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
let queue = self.queue.read().unwrap();
|
||||
queue.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user