Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
minor changes
  • Loading branch information
rlkelly committed May 15, 2018
commit d42d024d9ca878c2e8c61de0e82682eeb05899eb
4 changes: 2 additions & 2 deletions src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ impl Bank {
.entry(tx_sig)
{
e.get_mut().apply_witness(&Witness::Signature(from));
if let Some(ref payment) = e.get().final_payment() {
apply_payment(&self.balances, payment);
if let Some(payment) = e.get().final_payment() {
apply_payment(&self.balances, &payment);
e.remove_entry();
}
};
Expand Down
12 changes: 6 additions & 6 deletions src/crdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! repair partitions.
//!
//! This CRDT only supports a very limited set of types. A map of PublicKey -> Versioned Struct.
//! The last version is always picked durring an update.
//! The last version is always picked during an update.
//!
//! The network is arranged in layers:
//!
Expand Down Expand Up @@ -89,7 +89,7 @@ pub struct Crdt {
/// should respond with all the identities that are greater then the
/// request's `update_index` in this list
local: HashMap<PublicKey, u64>,
/// The value of the remote update index that i have last seen
/// The value of the remote update index that I have last seen
/// This Node will ask external nodes for updates since the value in this list
pub remote: HashMap<PublicKey, u64>,
pub update_index: u64,
Expand Down Expand Up @@ -169,7 +169,7 @@ impl Crdt {
transmit_index: &mut u64,
) -> Result<()> {
let (me, table): (ReplicatedData, Vec<ReplicatedData>) = {
// copy to avoid locking durring IO
// copy to avoid locking during IO
let robj = obj.read().expect("'obj' read lock in pub fn broadcast");
info!("broadcast table {}", robj.table.len());
let cloned_table: Vec<ReplicatedData> = robj.table.values().cloned().collect();
Expand Down Expand Up @@ -197,7 +197,7 @@ impl Crdt {

info!("nodes table {}", nodes.len());
info!("blobs table {}", blobs.len());
// enumerate all the blobs, those are the indecies
// enumerate all the blobs, those are the indices
// transmit them to nodes, starting from a different node
let orders: Vec<_> = blobs
.iter()
Expand Down Expand Up @@ -245,7 +245,7 @@ impl Crdt {
/// We need to avoid having obj locked while doing any io, such as the `send_to`
pub fn retransmit(obj: &Arc<RwLock<Self>>, blob: &SharedBlob, s: &UdpSocket) -> Result<()> {
let (me, table): (ReplicatedData, Vec<ReplicatedData>) = {
// copy to avoid locking durring IO
// copy to avoid locking during IO
let s = obj.read().expect("'obj' read lock in pub fn retransmit");
(s.table[&s.me].clone(), s.table.values().cloned().collect())
};
Expand Down Expand Up @@ -439,7 +439,7 @@ impl Crdt {
Protocol::RequestUpdates(v, reqdata) => {
trace!("RequestUpdates {}", v);
let addr = reqdata.gossip_addr;
// only lock for this call, dont lock durring IO `sock.send_to` or `sock.recv_from`
// only lock for this call, dont lock during IO `sock.send_to` or `sock.recv_from`
let (from, ups, data) = obj.read()
.expect("'obj' read lock in RequestUpdates")
.get_updates_since(v);
Expand Down