mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
swarm/network: Wait in processDeliveries until hash is ready
This commit is contained in:
parent
2efb994c19
commit
1c7805bde4
1 changed files with 3 additions and 1 deletions
|
|
@ -72,11 +72,13 @@ func NewRetrieveRequestStreamer(db *DbAccess) *RetrieveRequestStreamer {
|
|||
// processDeliveries handles delivered chunk hashes
|
||||
func (s *RetrieveRequestStreamer) processDeliveries() {
|
||||
var hashes []byte
|
||||
var batchC chan []byte
|
||||
for {
|
||||
select {
|
||||
case delivery := <-s.deliveryC:
|
||||
hashes = append(hashes, delivery.Key[:]...)
|
||||
case s.batchC <- hashes:
|
||||
batchC = s.batchC
|
||||
case batchC <- hashes:
|
||||
hashes = nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue