mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-30 05:01:44 +00:00
errcheck; sort some stuff out
This commit is contained in:
committed by
Ethan Buchman
parent
563faa98de
commit
d7cb291fb2
10
p2p/util.go
10
p2p/util.go
@ -7,15 +7,9 @@ import (
|
||||
// doubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
|
||||
func doubleSha256(b []byte) []byte {
|
||||
hasher := sha256.New()
|
||||
_, err := hasher.Write(b)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_, _ := hasher.Write(b) // error ignored
|
||||
sum := hasher.Sum(nil)
|
||||
hasher.Reset()
|
||||
_, err = hasher.Write(sum)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_, _ = hasher.Write(sum) // error ignored
|
||||
return hasher.Sum(nil)
|
||||
}
|
||||
|
Reference in New Issue
Block a user