mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
swarm/chunk: change chunk.DefaultSize to be untyped const
This commit is contained in:
parent
275c5d3591
commit
1af15cf52f
3 changed files with 3 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
package chunk
|
package chunk
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DefaultSize int64 = 4096
|
DefaultSize = 4096
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ R:
|
||||||
continue R
|
continue R
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
if len(req.SData) > int(cp.DefaultSize) {
|
if len(req.SData) > cp.DefaultSize {
|
||||||
log.Warn("received chunk is bigger than expected", "len", len(req.SData))
|
log.Warn("received chunk is bigger than expected", "len", len(req.SData))
|
||||||
continue R
|
continue R
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ func MakeHashFunc(hash string) SwarmHasher {
|
||||||
return func() SwarmHash {
|
return func() SwarmHash {
|
||||||
hasher := sha3.NewKeccak256
|
hasher := sha3.NewKeccak256
|
||||||
hasherSize := hasher().Size()
|
hasherSize := hasher().Size()
|
||||||
segmentCount := int(chunk.DefaultSize) / hasherSize
|
segmentCount := chunk.DefaultSize / hasherSize
|
||||||
pool := bmt.NewTreePool(hasher, segmentCount, bmt.PoolSize)
|
pool := bmt.NewTreePool(hasher, segmentCount, bmt.PoolSize)
|
||||||
return bmt.New(pool)
|
return bmt.New(pool)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue