mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
swarm/network/stream: add Client.Close() (#229)
This commit is contained in:
parent
f568ef178e
commit
5b19c2273f
2 changed files with 4 additions and 0 deletions
|
|
@ -298,6 +298,7 @@ type client struct {
|
||||||
type Client interface {
|
type Client interface {
|
||||||
NeedData([]byte) func()
|
NeedData([]byte) func()
|
||||||
BatchDone(string, uint64, []byte, []byte) func() (*TakeoverProof, error)
|
BatchDone(string, uint64, []byte, []byte) func() (*TakeoverProof, error)
|
||||||
|
Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// nextBatch adjusts the indexes by inspecting the intervals
|
// nextBatch adjusts the indexes by inspecting the intervals
|
||||||
|
|
@ -344,6 +345,7 @@ func (c *client) batchDone(p *Peer, req *OfferedHashesMsg, hashes []byte) error
|
||||||
|
|
||||||
func (c *client) close() {
|
func (c *client) close() {
|
||||||
close(c.next)
|
close(c.next)
|
||||||
|
c.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spec is the spec of the streamer protocol
|
// Spec is the spec of the streamer protocol
|
||||||
|
|
|
||||||
|
|
@ -253,3 +253,5 @@ func (s *SwarmSyncerClient) TakeoverProof(streamName string, from uint64, hashes
|
||||||
Sig: nil,
|
Sig: nil,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *SwarmSyncerClient) Close() {}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue