Browse Source

lil fixes

pull/703/head
Zach Ramsay 7 years ago
committed by Ethan Buchman
parent
commit
d033470817
5 changed files with 6 additions and 6 deletions
  1. +1
    -1
      p2p/addrbook.go
  2. +1
    -1
      p2p/connection.go
  3. +1
    -1
      p2p/listener.go
  4. +2
    -2
      p2p/secret_connection.go
  5. +1
    -1
      rpc/lib/client/ws_client_test.go

+ 1
- 1
p2p/addrbook.go View File

@ -371,7 +371,7 @@ func (a *AddrBook) loadFromFile(filePath string) bool {
if err != nil {
cmn.PanicCrisis(cmn.Fmt("Error opening file %s: %v", filePath, err))
}
defer r.Close() // nolint (errcheck)
defer r.Close() // nolint: errcheck
aJSON := &addrBookJSON{}
dec := json.NewDecoder(r)
err = dec.Decode(aJSON)


+ 1
- 1
p2p/connection.go View File

@ -184,7 +184,7 @@ func (c *MConnection) OnStop() {
if c.quit != nil {
close(c.quit)
}
c.conn.Close() // nolint (errcheck)
c.conn.Close() // nolint: errcheck
// We can't close pong safely here because
// recvRoutine may write to it after we've stopped.
// Though it doesn't need to get closed at all,


+ 1
- 1
p2p/listener.go View File

@ -117,7 +117,7 @@ func (l *DefaultListener) OnStart() error {
func (l *DefaultListener) OnStop() {
l.BaseService.OnStop()
l.listener.Close() // nolint (errcheck)
l.listener.Close() // nolint: errcheck
}
// Accept connections and pass on the channel


+ 2
- 2
p2p/secret_connection.go View File

@ -302,7 +302,7 @@ func shareAuthSignature(sc *SecretConnection, pubKey crypto.PubKeyEd25519, signa
// sha256
func hash32(input []byte) (res *[32]byte) {
hasher := sha256.New()
_, _ = hasher.Write(input) // ignoring error
_, _ = hasher.Write(input) // error ignored
resSlice := hasher.Sum(nil)
res = new([32]byte)
copy(res[:], resSlice)
@ -312,7 +312,7 @@ func hash32(input []byte) (res *[32]byte) {
// We only fill in the first 20 bytes with ripemd160
func hash24(input []byte) (res *[24]byte) {
hasher := ripemd160.New()
_, _ = hasher.Write(input) // ignoring error
_, _ = hasher.Write(input) // error ignored
resSlice := hasher.Sum(nil)
res = new([24]byte)
copy(res[:], resSlice)


+ 1
- 1
rpc/lib/client/ws_client_test.go View File

@ -105,7 +105,7 @@ func TestWSClientReconnectsAfterWriteFailure(t *testing.T) {
// hacky way to abort the connection before write
if err := c.conn.Close(); err != nil {
panic(err)
t.Error(err)
}
// results in WS write error, the client should resend on reconnect


Loading…
Cancel
Save