Skip to content

Conversation

@Alex-van-der-Peet
Copy link
Contributor

On calling addnode remove, now disconnects from said node immediately per issue #2729. Requires the port to be specified in the IP parameter for it to be found and disconnected however.

@jonasschnelli
Copy link
Contributor

Not against this.

But a pure disconnect won't prevent from a reconnect of the just kicked node.

I think the setban rpc command (#6158) would suit better for a node kick (kick and ban for 1h).

For this PR two things would be cool:

  • ban disconnected nodes for 1h (or at least 10mins)
  • allow removing nodes by IP without port (kick all nodes from the given IP)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F.I.Y.: most one-line-ifs in the source codes are without brackets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're absolutely right, missed some clean up there, my bad.

@luke-jr
Copy link
Member

luke-jr commented Jun 9, 2015

I don't think it makes sense to disconnect from a peer merely because you remove it from the "persistent" addnode list...

@laanwj
Copy link
Member

laanwj commented Jun 10, 2015

Thanks for taking a stab at implementing this, concept ACK.

@luke-jr Agreed. This is useful functionality (now available in the GUI but not on RPC), however this is the wrong place. Let's just add a disconnectnode RPC.

@jgarzik
Copy link
Contributor

jgarzik commented Jun 10, 2015

+1 @laanwj RE "disconnectnode"

It is also odd that an "addnode" RPC actually performs the opposite of an "add"

@Alex-van-der-Peet
Copy link
Contributor Author

@jgarzik Yeh that was my comment on the original issue too, but I thought what the hey, here's an issue I can actually take care of, I'll give it a shot.

Will take a look at adding disconnectnode later this week, leave it with me.

@franko-org
Copy link

disconnectnode imho makes more sense to me. Maybe even just a "node" call that takes specific commands. IE node ban, node add, node disconnect.

@laanwj
Copy link
Member

laanwj commented Jun 11, 2015

@franko-org That would be possible, but e.g. with help it's handier to see what is available in one glance. I don't see an advantage to be particlularly thrifty with adding RPC calls. This gave us peculiar constructs like addnode remove in the first place :)

In retrospect, the RPC mechanism would have benefitted from namespacing (node.X, wallet.X etc) but doing that for one call is inconsistent.

@laanwj
Copy link
Member

laanwj commented Jun 12, 2015

Closing in favor of #6271

@laanwj laanwj closed this Jun 12, 2015
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants