diff --git a/pkg/feeds/getter.go b/pkg/feeds/getter.go index 9fcb2ccae77..5f902703ef8 100644 --- a/pkg/feeds/getter.go +++ b/pkg/feeds/getter.go @@ -6,7 +6,6 @@ package feeds import ( "context" - "encoding/binary" "errors" "fmt" "time" @@ -60,7 +59,7 @@ func GetWrappedChunk(ctx context.Context, getter storage.Getter, ch swarm.Chunk) // possible values right now: // unencrypted ref: span+timestamp+ref => 8+8+32=48 // encrypted ref: span+timestamp+ref+decryptKey => 8+8+64=80 - _, ref, err := LegacyPayload(wc) + ref, err := legacyPayload(wc) if err != nil { if errors.Is(err, errNotLegacyPayload) { return wc, nil @@ -84,14 +83,12 @@ func FromChunk(ch swarm.Chunk) (swarm.Chunk, error) { return s.WrappedChunk(), nil } -// LegacyPayload returns back the referenced chunk and datetime from the legacy feed payload -func LegacyPayload(wrappedChunk swarm.Chunk) (uint64, swarm.Address, error) { +// legacyPayload returns back the referenced chunk and datetime from the legacy feed payload +func legacyPayload(wrappedChunk swarm.Chunk) (swarm.Address, error) { cacData := wrappedChunk.Data() if !(len(cacData) == 16+swarm.HashSize || len(cacData) == 16+swarm.HashSize*2) { - return 0, swarm.ZeroAddress, errNotLegacyPayload + return swarm.ZeroAddress, errNotLegacyPayload } - address := swarm.NewAddress(cacData[16:]) - at := binary.BigEndian.Uint64(cacData[8:16]) - return at, address, nil + return swarm.NewAddress(cacData[16:]), nil }