mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
swarm: Use ResourceHandlerParams in swarm.go
This commit is contained in:
parent
64b4a0ba6f
commit
8561834ded
1 changed files with 5 additions and 3 deletions
|
|
@ -194,11 +194,13 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.
|
|||
var resourceHandler *storage.ResourceHandler
|
||||
// if use resource updates
|
||||
if self.config.ResourceEnabled && resolver != nil {
|
||||
resourceValidator := storage.NewENSValidator(config.EnsRoot, resolver, storage.NewGenericResourceSigner(self.privateKey))
|
||||
resolver.SetNameHash(resourceValidator.NameHash)
|
||||
resourceparams := &storage.ResourceHandlerParams{
|
||||
Validator: storage.NewENSValidator(config.EnsRoot, resolver, storage.NewGenericResourceSigner(self.privateKey)),
|
||||
}
|
||||
resolver.SetNameHash(resourceparams.Validator.NameHash)
|
||||
hashfunc := storage.MakeHashFunc(storage.SHA3Hash)
|
||||
chunkStore := storage.NewResourceChunkStore(self.lstore, func(*storage.Chunk) error { return nil })
|
||||
resourceHandler, err = storage.NewResourceHandler(hashfunc, chunkStore, resolver, resourceValidator)
|
||||
resourceHandler, err = storage.NewResourceHandler(hashfunc, chunkStore, resolver, resourceparams)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue