mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +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
|
key string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Intervals) load() error {
|
// func (s *Intervals) load() error {
|
||||||
return s.streamer.load(s.key)
|
// return s.streamer.load(s.key)
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
func (s *Intervals) save() error {
|
// func (s *Intervals) save() error {
|
||||||
return s.streamer.save(s.key)
|
// return s.streamer.save(s.key)
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
func (s *Intervals) get() []uint64 {
|
// func (s *Intervals) get() []uint64 {
|
||||||
return s.streamer.get(s.key)
|
// return s.streamer.get(s.key)
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
func (s *Intervals) set(v []uint64) {
|
// func (s *Intervals) set(v []uint64) {
|
||||||
s.streamer.set(s.key, v)
|
// s.streamer.set(s.key, v)
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
func NewIntervals(key string, s *Streamer) *Intervals {
|
// func NewIntervals(key string, s *Streamer) *Intervals {
|
||||||
return &Intervals{
|
// return &Intervals{
|
||||||
streamer: s,
|
// streamer: s,
|
||||||
key: key,
|
// key: key,
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// RetrieveRequestStreamer implements OutgoingStreamer
|
// RetrieveRequestStreamer implements OutgoingStreamer
|
||||||
type RetrieveRequestStreamer struct {
|
type RetrieveRequestStreamer struct {
|
||||||
|
|
|
||||||
|
|
@ -370,14 +370,14 @@ func (self *StreamerPeer) setIncomingStreamer(s string, i IncomingStreamer, prio
|
||||||
return fmt.Errorf("stream %v already registered", s)
|
return fmt.Errorf("stream %v already registered", s)
|
||||||
}
|
}
|
||||||
next := make(chan struct{}, 1)
|
next := make(chan struct{}, 1)
|
||||||
var intervals *Intervals
|
// var intervals *Intervals
|
||||||
if !live {
|
// if !live {
|
||||||
key := s + self.ID().String()
|
// key := s + self.ID().String()
|
||||||
intervals = NewIntervals(key, self.streamer)
|
// intervals = NewIntervals(key, self.streamer)
|
||||||
}
|
// }
|
||||||
self.incoming[s] = &incomingStreamer{
|
self.incoming[s] = &incomingStreamer{
|
||||||
IncomingStreamer: i,
|
IncomingStreamer: i,
|
||||||
intervals: intervals,
|
// intervals: intervals,
|
||||||
live: live,
|
live: live,
|
||||||
priority: priority,
|
priority: priority,
|
||||||
next: next,
|
next: next,
|
||||||
|
|
@ -388,7 +388,7 @@ func (self *StreamerPeer) setIncomingStreamer(s string, i IncomingStreamer, prio
|
||||||
|
|
||||||
// NextBatch adjusts the indexes by inspecting the intervals
|
// NextBatch adjusts the indexes by inspecting the intervals
|
||||||
func (self *incomingStreamer) nextBatch(from uint64) (nextFrom uint64, nextTo uint64) {
|
func (self *incomingStreamer) nextBatch(from uint64) (nextFrom uint64, nextTo uint64) {
|
||||||
intervals := self.intervals.get()
|
var intervals []uint64
|
||||||
if self.live {
|
if self.live {
|
||||||
if len(intervals) == 0 {
|
if len(intervals) == 0 {
|
||||||
intervals = []uint64{self.sessionAt, from}
|
intervals = []uint64{self.sessionAt, from}
|
||||||
|
|
@ -411,7 +411,7 @@ func (self *incomingStreamer) nextBatch(from uint64) (nextFrom uint64, nextTo ui
|
||||||
intervals[1] = from
|
intervals[1] = from
|
||||||
nextTo = self.sessionAt
|
nextTo = self.sessionAt
|
||||||
}
|
}
|
||||||
self.intervals.set(intervals)
|
// self.intervals.set(intervals)
|
||||||
return nextFrom, nextTo
|
return nextFrom, nextTo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue