p2p: use an error type for disconnect requests

Test-tastic.
This commit is contained in:
Felix Lange
2014-12-12 11:58:39 +01:00
parent 65e39bf20e
commit f0f6727778
2 changed files with 10 additions and 2 deletions

View File

@@ -158,8 +158,7 @@ func (bp *baseProtocol) handle(rw MsgReadWriter) error {
if err := msg.Decode(&reason); err != nil {
return err
}
bp.peer.Disconnect(reason[0])
return nil
return discRequestedError(reason[0])
case pingMsg:
return bp.rw.EncodeMsg(pongMsg)