Update error handling on p2p sending
disconnect on send failure, even temporary error
@@ -494,16 +494,9 @@ Loop:
if err := p.sendDirect(pkt); err != nil {
r := p.isTemporaryError(err)
p.logger.Tracef("Peer.sendRoutine Error isTemporary:{%v} error:{%+v} peer:%s", r, err, p.String())
- if !r {
p.CloseByError(err)
return
}
- if cbFunc := p.getErrorCbFunc(); cbFunc != nil {
- cbFunc(err, p, pkt)
- } else {
- defaultOnError(err, p, pkt)
- }
- }
//TODO peer.packet_dump
if isLoggingPacket {
log.Println(p.id, "Peer", "sendRoutine", p.connType, p.ConnString(), pkt)
