mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-25 03:45:53 +00:00
fmt
This commit is contained in:
parent
ad140a04c3
commit
3199700e0b
1 changed files with 11 additions and 2 deletions
|
@ -75,7 +75,13 @@ impl<N: NetworkZone> ChainTracker<N> {
|
|||
let mut entries = VecDeque::with_capacity(1);
|
||||
entries.push_back(new_entry);
|
||||
|
||||
Self { entries, first_height, top_seen_hash, previous_hash, our_genesis }
|
||||
Self {
|
||||
entries,
|
||||
first_height,
|
||||
top_seen_hash,
|
||||
previous_hash,
|
||||
our_genesis,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the peer is expected to have the next block after our highest seen block
|
||||
|
@ -112,7 +118,10 @@ impl<N: NetworkZone> ChainTracker<N> {
|
|||
}
|
||||
|
||||
/// Attempts to add an incoming [`ChainEntry`] to the chain tracker.
|
||||
pub(crate) fn add_entry(&mut self, mut chain_entry: ChainEntry<N>) -> Result<(), ChainTrackerError> {
|
||||
pub(crate) fn add_entry(
|
||||
&mut self,
|
||||
mut chain_entry: ChainEntry<N>,
|
||||
) -> Result<(), ChainTrackerError> {
|
||||
if chain_entry.ids.is_empty() {
|
||||
// The peer must send at lest one overlapping block.
|
||||
chain_entry.handle.ban_peer(MEDIUM_BAN);
|
||||
|
|
Loading…
Reference in a new issue