handle success return value separately
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
9d236b298a
commit
51c30bfa51
10
control.go
10
control.go
|
@ -25,18 +25,24 @@ func (s *StateController) Fetch() {
|
|||
// For removing a selected peer from connected to status-go
|
||||
func (s *StateController) TrustPeer(peer *Peer) error {
|
||||
success, err := s.Client.trustPeer(peer.Enode)
|
||||
if err != nil || success != true {
|
||||
if err != nil {
|
||||
log.Panicln(err)
|
||||
}
|
||||
if success != true {
|
||||
log.Panicln("failed to trust whisper peer")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// For removing a selected peer from connected to status-go
|
||||
func (s *StateController) RemovePeer(peer *Peer) error {
|
||||
success, err := s.Client.removePeer(peer.Enode)
|
||||
if err != nil || success != true {
|
||||
if err != nil {
|
||||
log.Panicln(err)
|
||||
}
|
||||
if success != true {
|
||||
log.Panicln("failed to remove peer")
|
||||
}
|
||||
s.Fetch()
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue