Author

Topic: Instructing a node to disconnect from a specific peer via RPC (Read 1056 times)

newbie
Activity: 25
Merit: 66
Excellent. I added in the functionality over the weekend and the only way that seemed appropriate was to call CloseSocketDisconnect(), but I'm not nearly as familiar with the codebase as you!
legendary
Activity: 1652
Merit: 2311
Chief Scientist
I needed that, so hacked together a disconnectpeer RPC call:
  https://github.com/gavinandresen/bitcoin-git/commit/499ae0b3d77e1c41d79f34329d555980676d1f3a

Needs more thorough testing-- I'm not sure if calling CloseSocketDisconnect directly from the RPC thread is the cleanest way of disconnecting a peer.
newbie
Activity: 25
Merit: 66
I'm working on a daemon to manage peer connections across multiple nodes but seem to have hit a wall when it comes to instructing a node to disconnect from a peer. I have succeeded in using the 'addnode' command to get my nodes to connect to specific peers, but apparently using the 'remove' option does not force a disconnect from the peer.

Is there any way for me to achieve peer disconnects via the RPC API?

If not, would it make sense for me to submit a pull request to add a 'disconnect' option to the 'addnode' RPC call?
Jump to: