Skip to content

Commit

Permalink
review style issues addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Jul 27, 2018
1 parent d8c3c38 commit 52ab007
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
17 changes: 12 additions & 5 deletions ethcore/light/src/client/snapshot/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ impl RestorationTargetChain for LightChain {
}

fn add_child(&self, _batch: &mut DBTransaction, _block_hash: H256, _child_hash: H256) {
// TODO
// We don't store parent <-> child relationship in the light client.
}

fn insert_epoch_transition(
&self, batch: &mut DBTransaction,
header: Header, transition: EpochTransition
&self,
batch: &mut DBTransaction,
header: Header,
transition: EpochTransition,
) {
let result = if header.number() == 0 {
let td = self.chain.genesis_header().difficulty();
Expand All @@ -91,8 +93,13 @@ impl RestorationTargetChain for LightChain {
}

fn insert_unordered_block(
&self, batch: &mut DBTransaction, bytes: &[u8], _receipts: Vec<Receipt>,
parent_td: Option<U256>, _is_best: bool, _is_ancient: bool
&self,
batch: &mut DBTransaction,
bytes: &[u8],
_receipts: Vec<Receipt>,
parent_td: Option<U256>,
_is_best: bool,
_is_ancient: bool,
) -> bool {
let block = view!(BlockView, bytes);
let header = block.header();
Expand Down
6 changes: 3 additions & 3 deletions ethcore/sync/src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ const MAX_TRANSACTIONS_TO_QUERY: usize = 4096;
// Maximal number of transactions in sent in single packet.
const MAX_TRANSACTIONS_TO_PROPAGATE: usize = 64;
/// Min number of blocks to be behind for a snapshot sync
pub const SNAPSHOT_RESTORE_THRESHOLD: BlockNumber = 30000;
pub const SNAPSHOT_MIN_PEERS: usize = 3;
pub(crate) const SNAPSHOT_RESTORE_THRESHOLD: BlockNumber = 30000;
pub(crate) const SNAPSHOT_MIN_PEERS: usize = 3;

pub const STATUS_PACKET: u8 = 0x00;
pub(crate) const STATUS_PACKET: u8 = 0x00;
const NEW_BLOCK_HASHES_PACKET: u8 = 0x01;
const TRANSACTIONS_PACKET: u8 = 0x02;
pub const GET_BLOCK_HEADERS_PACKET: u8 = 0x03;
Expand Down
4 changes: 1 addition & 3 deletions ethcore/sync/src/light_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,7 @@ impl<L: AsLightClient + Send + Sync> Handler for LightSync<L> {

fn on_disconnect(&self, ctx: &EventContext, unfulfilled: &[ReqId]) {
match *self.state.lock() {
SyncState::Snapshot(_) => {
return;
},
SyncState::Snapshot(_) => return,
_ => {},
};

Expand Down

0 comments on commit 52ab007

Please sign in to comment.