mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12: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
|
||||
|
||||
const (
|
||||
DefaultSize int64 = 4096
|
||||
DefaultSize = 4096
|
||||
)
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ R:
|
|||
continue R
|
||||
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))
|
||||
continue R
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ func MakeHashFunc(hash string) SwarmHasher {
|
|||
return func() SwarmHash {
|
||||
hasher := sha3.NewKeccak256
|
||||
hasherSize := hasher().Size()
|
||||
segmentCount := int(chunk.DefaultSize) / hasherSize
|
||||
segmentCount := chunk.DefaultSize / hasherSize
|
||||
pool := bmt.NewTreePool(hasher, segmentCount, bmt.PoolSize)
|
||||
return bmt.New(pool)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue