aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/stream
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2018-12-24 00:31:32 +0800
committerGitHub <noreply@github.com>2018-12-24 00:31:32 +0800
commit9e9fc87e70accf2b81be8772ab2ab0c914e95666 (patch)
tree410ccdefb083b08796a14ac03653a5319e9895d7 /swarm/network/stream
parent335760bf0674ee553f3ca65afd6f29b6557d1b55 (diff)
downloadgo-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.tar.gz
go-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.tar.zst
go-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.zip
swarm: remove unused/dead code (#18351)
Diffstat (limited to 'swarm/network/stream')
-rw-r--r--swarm/network/stream/intervals/store_test.go3
-rw-r--r--swarm/network/stream/stream.go8
-rw-r--r--swarm/network/stream/syncer.go56
3 files changed, 3 insertions, 64 deletions
diff --git a/swarm/network/stream/intervals/store_test.go b/swarm/network/stream/intervals/store_test.go
index 0ab14c065..a36814b71 100644
--- a/swarm/network/stream/intervals/store_test.go
+++ b/swarm/network/stream/intervals/store_test.go
@@ -17,14 +17,11 @@
package intervals
import (
- "errors"
"testing"
"github.com/ethereum/go-ethereum/swarm/state"
)
-var ErrNotFound = errors.New("not found")
-
// TestInmemoryStore tests basic functionality of InmemoryStore.
func TestInmemoryStore(t *testing.T) {
testStore(t, state.NewInmemoryStore())
diff --git a/swarm/network/stream/stream.go b/swarm/network/stream/stream.go
index 32e107823..090bef8d1 100644
--- a/swarm/network/stream/stream.go
+++ b/swarm/network/stream/stream.go
@@ -388,14 +388,6 @@ func (r *Registry) Quit(peerId enode.ID, s Stream) error {
return peer.Send(context.TODO(), msg)
}
-func (r *Registry) NodeInfo() interface{} {
- return nil
-}
-
-func (r *Registry) PeerInfo(id enode.ID) interface{} {
- return nil
-}
-
func (r *Registry) Close() error {
return r.intervalsStore.Close()
}
diff --git a/swarm/network/stream/syncer.go b/swarm/network/stream/syncer.go
index 4bfbac8b0..4fb8b9342 100644
--- a/swarm/network/stream/syncer.go
+++ b/swarm/network/stream/syncer.go
@@ -127,19 +127,9 @@ func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint6
// SwarmSyncerClient
type SwarmSyncerClient struct {
- sessionAt uint64
- nextC chan struct{}
- sessionRoot storage.Address
- sessionReader storage.LazySectionReader
- retrieveC chan *storage.Chunk
- storeC chan *storage.Chunk
- store storage.SyncChunkStore
- // chunker storage.Chunker
- currentRoot storage.Address
- requestFunc func(chunk *storage.Chunk)
- end, start uint64
- peer *Peer
- stream Stream
+ store storage.SyncChunkStore
+ peer *Peer
+ stream Stream
}
// NewSwarmSyncerClient is a contructor for provable data exchange syncer
@@ -209,46 +199,6 @@ func (s *SwarmSyncerClient) BatchDone(stream Stream, from uint64, hashes []byte,
return nil
}
-func (s *SwarmSyncerClient) TakeoverProof(stream Stream, from uint64, hashes []byte, root storage.Address) (*TakeoverProof, error) {
- // for provable syncer currentRoot is non-zero length
- // TODO: reenable this with putter/getter
- // if s.chunker != nil {
- // if from > s.sessionAt { // for live syncing currentRoot is always updated
- // //expRoot, err := s.chunker.Append(s.currentRoot, bytes.NewReader(hashes), s.retrieveC, s.storeC)
- // expRoot, _, err := s.chunker.Append(s.currentRoot, bytes.NewReader(hashes), s.retrieveC)
- // if err != nil {
- // return nil, err
- // }
- // if !bytes.Equal(root, expRoot) {
- // return nil, fmt.Errorf("HandoverProof mismatch")
- // }
- // s.currentRoot = root
- // } else {
- // expHashes := make([]byte, len(hashes))
- // _, err := s.sessionReader.ReadAt(expHashes, int64(s.end*HashSize))
- // if err != nil && err != io.EOF {
- // return nil, err
- // }
- // if !bytes.Equal(expHashes, hashes) {
- // return nil, errors.New("invalid proof")
- // }
- // }
- // return nil, nil
- // }
- s.end += uint64(len(hashes)) / HashSize
- takeover := &Takeover{
- Stream: stream,
- Start: s.start,
- End: s.end,
- Root: root,
- }
- // serialise and sign
- return &TakeoverProof{
- Takeover: takeover,
- Sig: nil,
- }, nil
-}
-
func (s *SwarmSyncerClient) Close() {}
// base for parsing and formating sync bin key