Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ban a fraud peer which claims a fake height and total difficulty #2237

Merged
merged 4 commits into from
Dec 28, 2018
Merged

Ban a fraud peer which claims a fake height and total difficulty #2237

merged 4 commits into from
Dec 28, 2018

Conversation

garyyu
Copy link
Contributor

@garyyu garyyu commented Dec 27, 2018

Fix for #2 problem: #2233 (comment)

No.2 - If a new node is syncing but with this fraud peer connected, it will stuck at Header Syncing stage for ever.

@garyyu
Copy link
Contributor Author

garyyu commented Dec 27, 2018

The banned state can't save into the database, that's driving me crazy!

	/// Ban a peer, disconnecting it if we're currently connected
	pub fn ban_peer(&self, peer_addr: &SocketAddr, ban_reason: ReasonForBan) {
		if let Err(e) = self.update_state(*peer_addr, State::Banned) {
			error!("Couldn't ban {}: {:?}", peer_addr, e);
		}

This ban_peer function is called successfully, but the banned peer always can connect again.

What I have missed?

[Updated]
A related issue is found in #2241
So, this PR should be OK now, #2241 issue will be fixed in another PR.

@ignopeverell ignopeverell merged commit c0507b2 into mimblewimble:master Dec 28, 2018
@garyyu garyyu deleted the fraud-peer-#2 branch January 3, 2019 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants