network: add message type to disconnect error message
If it was caused by message processing, but only after the handshake to preserve errIdenticalID and other handshaking errors.
This commit is contained in:
parent
b79abd1e27
commit
1c28dd2567
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ package network
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
@ -131,6 +132,9 @@ func (p *TCPPeer) handleConn() {
|
|||
break
|
||||
}
|
||||
if err = p.server.handleMessage(p, msg); err != nil {
|
||||
if p.Handshaked() {
|
||||
err = fmt.Errorf("handling %s message: %v", msg.CommandType(), err)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue