@@ -22,7 +22,6 @@ import (
22
22
"crypto/ecdsa"
23
23
"encoding/hex"
24
24
"errors"
25
- "fmt"
26
25
"net"
27
26
"sort"
28
27
"sync"
@@ -391,7 +390,7 @@ type sharedUDPConn struct {
391
390
func (s * sharedUDPConn ) ReadFromUDP (b []byte ) (n int , addr * net.UDPAddr , err error ) {
392
391
packet , ok := <- s .unhandled
393
392
if ! ok {
394
- return 0 , nil , fmt . Errorf ("Connection was closed" )
393
+ return 0 , nil , errors . New ("Connection was closed" )
395
394
}
396
395
l := len (packet .Data )
397
396
if l > len (b ) {
@@ -425,7 +424,7 @@ func (srv *Server) Start() (err error) {
425
424
426
425
// static fields
427
426
if srv .PrivateKey == nil {
428
- return fmt . Errorf ("Server.PrivateKey must be set to a non-nil key" )
427
+ return errors . New ("Server.PrivateKey must be set to a non-nil key" )
429
428
}
430
429
if srv .newTransport == nil {
431
430
srv .newTransport = newRLPX
@@ -903,7 +902,7 @@ func (srv *Server) setupConn(c *conn, flags connFlag, dialDest *enode.Node) erro
903
902
if dialDest != nil {
904
903
dialPubkey = new (ecdsa.PublicKey )
905
904
if err := dialDest .Load ((* enode .Secp256k1 )(dialPubkey )); err != nil {
906
- return fmt . Errorf ("dial destination doesn't have a secp256k1 public key" )
905
+ return errors . New ("dial destination doesn't have a secp256k1 public key" )
907
906
}
908
907
}
909
908
// Run the encryption handshake.
@@ -937,7 +936,7 @@ func (srv *Server) setupConn(c *conn, flags connFlag, dialDest *enode.Node) erro
937
936
return err
938
937
}
939
938
if id := c .node .ID (); ! bytes .Equal (crypto .Keccak256 (phs .ID ), id [:]) {
940
- clog .Trace ("Wrong devp2p handshake identity" , "phsid" , fmt . Sprintf ( "%x" , phs .ID ))
939
+ clog .Trace ("Wrong devp2p handshake identity" , "phsid" , hex . EncodeToString ( phs .ID ))
941
940
return DiscUnexpectedIdentity
942
941
}
943
942
c .caps , c .name = phs .Caps , phs .Name
0 commit comments