Remove `push` from `TransactionQueue` trait.

This commit is contained in:
Marc Brinkmann 2018-10-11 15:43:33 +02:00
parent 59444fcf7b
commit 78dd3db474
2 changed files with 2 additions and 9 deletions

View File

@ -22,9 +22,9 @@
//! entries, any two nodes will likely make almost disjoint contributions instead of proposing
//! the same transaction multiple times.
use std::cmp;
use std::fmt::{self, Display};
use std::marker::PhantomData;
use std::{cmp, iter};
use failure::{Backtrace, Context, Fail};
use rand::{Rand, Rng};
@ -224,7 +224,7 @@ where
// in addition signed and broadcast.
let mut step = match input {
Input::User(tx) => {
self.queue.push(tx);
self.queue.extend(iter::once(tx));
Step::default()
}
Input::Change(change) => self

View File

@ -11,8 +11,6 @@ use Contribution;
pub trait TransactionQueue<T>: fmt::Debug + Default + Extend<T> + Sync + Send {
/// Checks whether the queue is empty.
fn is_empty(&self) -> bool;
/// Appends an element at the end of the queue.
fn push(&mut self, t: T);
/// Returns a new set of `amount` transactions, randomly chosen from the first `batch_size`.
/// No transactions are removed from the queue.
// TODO: Return references, once the `HoneyBadger` API accepts them.
@ -33,11 +31,6 @@ where
self.is_empty()
}
#[inline]
fn push(&mut self, t: T) {
self.push(t);
}
fn remove_multiple<'a, I>(&mut self, txs: I)
where
I: IntoIterator<Item = &'a T>,