mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
swarm/storage: Clean up after rebase swarm-mutableresources-errors
This commit is contained in:
parent
2e4da30279
commit
2a70739e6f
1 changed files with 2 additions and 2 deletions
|
|
@ -566,7 +566,7 @@ func (self *ResourceHandler) parseUpdate(chunkdata []byte) (*Signature, uint32,
|
|||
|
||||
func (self *ResourceHandler) UpdateMultihash(ctx context.Context, name string, data []byte) (Key, error) {
|
||||
if isMultihash(data) == 0 {
|
||||
return nil, NewResourceError(ErrNoData, "Invalid multihash")
|
||||
return nil, NewResourceError(ErrNothingToReturn, "Invalid multihash")
|
||||
}
|
||||
return self.update(ctx, name, data, true)
|
||||
}
|
||||
|
|
@ -859,7 +859,7 @@ func (self *ResourceHandler) keyDataHash(key Key, data []byte) common.Hash {
|
|||
// if successful it returns the length of multihash data, 0 otherwise
|
||||
func isMultihash(data []byte) int {
|
||||
cursor := 0
|
||||
hashtype, c := binary.Uvarint(data)
|
||||
_, c := binary.Uvarint(data)
|
||||
if c <= 0 {
|
||||
log.Warn("Corrupt multihash data, hashtype is unreadable")
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue