Reimplement AddPeer and RemovePeer for admin socket (#951)

* Reimplement AddPeer and RemovePeer for admin socket

Fix #950

* Disconnect the peer on `removePeer`

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
ehmry 2022-10-02 06:35:43 -05:00 committed by GitHub
parent c922eba2d8
commit 7db934488e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 97 additions and 73 deletions

View file

@ -7,7 +7,7 @@ import (
func (c *Core) _applyOption(opt SetupOption) {
switch v := opt.(type) {
case Peer:
c.config._peers[v] = struct{}{}
c.config._peers[v] = nil
case ListenAddress:
c.config._listeners[v] = struct{}{}
case NodeInfo: