mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
swarm/storage: reset the base hash to SHA3. !!hard fork = no backward compatibility :)
This commit is contained in:
parent
7aee835b36
commit
2371ac7265
1 changed files with 4 additions and 3 deletions
|
|
@ -38,8 +38,8 @@ data_{i} := size(subtree_{i}) || key_{j} || key_{j+1} .... || key_{j+n-1}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// defaultHash = "SHA3" // http://golang.org/pkg/hash/#Hash
|
defaultHash = "SHA3" // http://golang.org/pkg/hash/#Hash
|
||||||
defaultHash = "SHA256" // http://golang.org/pkg/hash/#Hash
|
// defaultHash = "SHA256" // http://golang.org/pkg/hash/#Hash
|
||||||
defaultBranches int64 = 128
|
defaultBranches int64 = 128
|
||||||
// hashSize int64 = hasherfunc.New().Size() // hasher knows about its own length in bytes
|
// hashSize int64 = hasherfunc.New().Size() // hasher knows about its own length in bytes
|
||||||
// chunksize int64 = branches * hashSize // chunk is defined as this
|
// chunksize int64 = branches * hashSize // chunk is defined as this
|
||||||
|
|
@ -364,7 +364,8 @@ func (self *LazyChunkReader) join(b []byte, off int64, eoff int64, depth int, tr
|
||||||
// glog.V(logger.Detail).Infof("[BZZ] depth: %v, len(b): %v, off: %v, eoff: %v, chunk.Size: %v, treeSize: %v", depth, len(b), off, eoff, chunk.Size, treeSize)
|
// glog.V(logger.Detail).Infof("[BZZ] depth: %v, len(b): %v, off: %v, eoff: %v, chunk.Size: %v, treeSize: %v", depth, len(b), off, eoff, chunk.Size, treeSize)
|
||||||
if int64(len(b)) != eoff-off {
|
if int64(len(b)) != eoff-off {
|
||||||
//fmt.Printf("len(b) = %v off = %v eoff = %v", len(b), off, eoff)
|
//fmt.Printf("len(b) = %v off = %v eoff = %v", len(b), off, eoff)
|
||||||
panic("len(b) does not match")
|
msg := fmt.Sprintf("len(b) = %v =?= %v = eoff-off", len(b), eoff-off)
|
||||||
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
copy(b, chunk.SData[8+off:8+eoff])
|
copy(b, chunk.SData[8+off:8+eoff])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue