mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
Temporarily remove/comment Intervals code
Later we will have to decide what to do with it, but first let's make it compile
This commit is contained in:
parent
c8f51a2e6d
commit
01fd455d6b
2 changed files with 33 additions and 33 deletions
|
|
@ -27,28 +27,28 @@ type Intervals struct {
|
|||
key string
|
||||
}
|
||||
|
||||
func (s *Intervals) load() error {
|
||||
return s.streamer.load(s.key)
|
||||
}
|
||||
|
||||
func (s *Intervals) save() error {
|
||||
return s.streamer.save(s.key)
|
||||
}
|
||||
|
||||
func (s *Intervals) get() []uint64 {
|
||||
return s.streamer.get(s.key)
|
||||
}
|
||||
|
||||
func (s *Intervals) set(v []uint64) {
|
||||
s.streamer.set(s.key, v)
|
||||
}
|
||||
|
||||
func NewIntervals(key string, s *Streamer) *Intervals {
|
||||
return &Intervals{
|
||||
streamer: s,
|
||||
key: key,
|
||||
}
|
||||
}
|
||||
// func (s *Intervals) load() error {
|
||||
// return s.streamer.load(s.key)
|
||||
// }
|
||||
//
|
||||
// func (s *Intervals) save() error {
|
||||
// return s.streamer.save(s.key)
|
||||
// }
|
||||
//
|
||||
// func (s *Intervals) get() []uint64 {
|
||||
// return s.streamer.get(s.key)
|
||||
// }
|
||||
//
|
||||
// func (s *Intervals) set(v []uint64) {
|
||||
// s.streamer.set(s.key, v)
|
||||
// }
|
||||
//
|
||||
// func NewIntervals(key string, s *Streamer) *Intervals {
|
||||
// return &Intervals{
|
||||
// streamer: s,
|
||||
// key: key,
|
||||
// }
|
||||
// }
|
||||
|
||||
// RetrieveRequestStreamer implements OutgoingStreamer
|
||||
type RetrieveRequestStreamer struct {
|
||||
|
|
|
|||
|
|
@ -370,17 +370,17 @@ func (self *StreamerPeer) setIncomingStreamer(s string, i IncomingStreamer, prio
|
|||
return fmt.Errorf("stream %v already registered", s)
|
||||
}
|
||||
next := make(chan struct{}, 1)
|
||||
var intervals *Intervals
|
||||
if !live {
|
||||
key := s + self.ID().String()
|
||||
intervals = NewIntervals(key, self.streamer)
|
||||
}
|
||||
// var intervals *Intervals
|
||||
// if !live {
|
||||
// key := s + self.ID().String()
|
||||
// intervals = NewIntervals(key, self.streamer)
|
||||
// }
|
||||
self.incoming[s] = &incomingStreamer{
|
||||
IncomingStreamer: i,
|
||||
intervals: intervals,
|
||||
live: live,
|
||||
priority: priority,
|
||||
next: next,
|
||||
// intervals: intervals,
|
||||
live: live,
|
||||
priority: priority,
|
||||
next: next,
|
||||
}
|
||||
next <- struct{}{} // this is to allow wantedKeysMsg before first batch arrives
|
||||
return nil
|
||||
|
|
@ -388,7 +388,7 @@ func (self *StreamerPeer) setIncomingStreamer(s string, i IncomingStreamer, prio
|
|||
|
||||
// NextBatch adjusts the indexes by inspecting the intervals
|
||||
func (self *incomingStreamer) nextBatch(from uint64) (nextFrom uint64, nextTo uint64) {
|
||||
intervals := self.intervals.get()
|
||||
var intervals []uint64
|
||||
if self.live {
|
||||
if len(intervals) == 0 {
|
||||
intervals = []uint64{self.sessionAt, from}
|
||||
|
|
@ -411,7 +411,7 @@ func (self *incomingStreamer) nextBatch(from uint64) (nextFrom uint64, nextTo ui
|
|||
intervals[1] = from
|
||||
nextTo = self.sessionAt
|
||||
}
|
||||
self.intervals.set(intervals)
|
||||
// self.intervals.set(intervals)
|
||||
return nextFrom, nextTo
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue