diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-08-14 22:03:56 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-08-14 22:03:56 +0800 |
commit | 97887d98da703a31040bceee13bce9ee77fca673 (patch) | |
tree | ffc9a8a6fba087b26d33c0ef6c939a19aaaad8c9 /swarm/storage/pyramid.go | |
parent | 8a040de60bd6b740ebe87cd8e1fe6bfdb6635d2f (diff) | |
download | go-tangerine-97887d98da703a31040bceee13bce9ee77fca673.tar go-tangerine-97887d98da703a31040bceee13bce9ee77fca673.tar.gz go-tangerine-97887d98da703a31040bceee13bce9ee77fca673.tar.bz2 go-tangerine-97887d98da703a31040bceee13bce9ee77fca673.tar.lz go-tangerine-97887d98da703a31040bceee13bce9ee77fca673.tar.xz go-tangerine-97887d98da703a31040bceee13bce9ee77fca673.tar.zst go-tangerine-97887d98da703a31040bceee13bce9ee77fca673.zip |
swarm/network, swarm/storage: validate chunk size (#17397)
* swarm/network, swarm/storage: validate default chunk size
* swarm/bmt, swarm/network, swarm/storage: update BMT hash initialisation
* swarm/bmt: move segmentCount to tests
* swarm/chunk: change chunk.DefaultSize to be untyped const
* swarm/storage: add size validator
* swarm/storage: add chunk size validation to localstore
* swarm/storage: move validation from localstore to validator
* swarm/storage: global chunk rules in MRU
Diffstat (limited to 'swarm/storage/pyramid.go')
-rw-r--r-- | swarm/storage/pyramid.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/swarm/storage/pyramid.go b/swarm/storage/pyramid.go index 2923c81c5..36ff66d04 100644 --- a/swarm/storage/pyramid.go +++ b/swarm/storage/pyramid.go @@ -25,6 +25,7 @@ import ( "sync" "time" + "github.com/ethereum/go-ethereum/swarm/chunk" "github.com/ethereum/go-ethereum/swarm/log" ) @@ -101,11 +102,11 @@ func NewPyramidSplitterParams(addr Address, reader io.Reader, putter Putter, get New chunks to store are store using the putter which the caller provides. */ func PyramidSplit(ctx context.Context, reader io.Reader, putter Putter, getter Getter) (Address, func(context.Context) error, error) { - return NewPyramidSplitter(NewPyramidSplitterParams(nil, reader, putter, getter, DefaultChunkSize)).Split(ctx) + return NewPyramidSplitter(NewPyramidSplitterParams(nil, reader, putter, getter, chunk.DefaultSize)).Split(ctx) } func PyramidAppend(ctx context.Context, addr Address, reader io.Reader, putter Putter, getter Getter) (Address, func(context.Context) error, error) { - return NewPyramidSplitter(NewPyramidSplitterParams(addr, reader, putter, getter, DefaultChunkSize)).Append(ctx) + return NewPyramidSplitter(NewPyramidSplitterParams(addr, reader, putter, getter, chunk.DefaultSize)).Append(ctx) } // Entry to create a tree node |