mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Merge 8f03922f74 into f1986f86f2
This commit is contained in:
commit
af55be568a
2 changed files with 6 additions and 5 deletions
|
|
@ -184,8 +184,6 @@ func (self *TreeChunker) Split(data io.Reader, size int64, chunkC chan *Chunk, s
|
|||
|
||||
func (self *TreeChunker) split(depth int, treeSize int64, key Key, data io.Reader, size int64, jobC chan *hashJob, chunkC chan *Chunk, errC chan error, quitC chan bool, parentWg, swg, wwg *sync.WaitGroup) {
|
||||
|
||||
//
|
||||
|
||||
for depth > 0 && size < treeSize {
|
||||
treeSize /= self.branches
|
||||
depth--
|
||||
|
|
@ -482,7 +480,6 @@ func retrieve(key Key, chunkC chan *Chunk, quitC chan bool) *Chunk {
|
|||
}
|
||||
// waiting for the chunk retrieval
|
||||
select { // chunk.Size = int64(binary.LittleEndian.Uint64(chunk.SData[0:8]))
|
||||
|
||||
case <-quitC:
|
||||
// this is how we control process leakage (quitC is closed once join is finished (after timeout))
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -113,7 +113,9 @@ func (self *chunkerTester) Append(chunker Splitter, rootKey Key, data io.Reader,
|
|||
// getting data
|
||||
chunk.SData = stored.SData
|
||||
chunk.Size = int64(binary.LittleEndian.Uint64(chunk.SData[0:8]))
|
||||
close(chunk.C)
|
||||
if c := chunk.C; c != nil {
|
||||
close(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -159,7 +161,9 @@ func (self *chunkerTester) Join(chunker Chunker, key Key, c int, chunkC chan *Ch
|
|||
}
|
||||
chunk.SData = stored.SData
|
||||
chunk.Size = int64(binary.LittleEndian.Uint64(chunk.SData[0:8]))
|
||||
close(chunk.C)
|
||||
if c := chunk.C; c != nil {
|
||||
close(c)
|
||||
}
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue