diff --git a/src/accountant_skel.rs b/src/accountant_skel.rs index 7b4deb0c1d..f04949cd9e 100644 --- a/src/accountant_skel.rs +++ b/src/accountant_skel.rs @@ -19,7 +19,6 @@ use transaction::Transaction; pub struct AccountantSkel { pub acc: Accountant, pub last_id: Hash, - pub ledger: Vec, writer: W, subscribers: Vec, } @@ -29,7 +28,6 @@ pub struct AccountantSkel { pub enum Request { Transaction(Transaction), GetBalance { key: PublicKey }, - GetEntries { last_id: Hash }, GetId { is_last: bool }, } @@ -46,7 +44,6 @@ impl AccountantSkel { AccountantSkel { acc, last_id, - ledger: vec![], writer: w, subscribers: vec![], } @@ -61,8 +58,6 @@ impl AccountantSkel { // TODO: Handle errors. If TCP stream is closed, remove it. serialize_into(subscriber, &entry).unwrap(); } - - self.ledger.push(entry); } self.last_id } @@ -79,17 +74,6 @@ impl AccountantSkel { let val = self.acc.get_balance(&key); Some(Response::Balance { key, val }) } - Request::GetEntries { last_id } => { - self.sync(); - let entries = self.ledger - .iter() - .skip_while(|x| x.id != last_id) // log(n) way to find Entry with id == last_id. - .skip(1) // Skip the entry with last_id. - .take(256) // TODO: Take while the serialized entries fit into a 64k UDP packet. - .cloned() - .collect(); - Some(Response::Entries { entries }) - } Request::GetId { is_last } => Some(Response::Id { id: if is_last { self.sync()