MCPcopy Create free account
hub / github.com/CPChain/chain / Enqueue

Method Enqueue

protocols/cpc/fetcher/fetcher.go:207–218  ·  view source on GitHub ↗

Enqueue tries to fill gaps the the fetcher's future import queue.

(peer string, block *types.Block)

Source from the content-addressed store, hash-verified

205
206// Enqueue tries to fill gaps the the fetcher's future import queue.
207func (f *Fetcher) Enqueue(peer string, block *types.Block) error {
208 op := &inject{
209 origin: peer,
210 block: block,
211 }
212 select {
213 case f.inject <- op:
214 return nil
215 case <-f.quit:
216 return errTerminated
217 }
218}
219
220// FilterHeaders extracts all the headers that were explicitly requested by the fetcher,
221// returning those that should be handled differently.

Callers 5

handleSyncMsgMethod · 0.80
TestQueueGapFillFunction · 0.80
TestImportDeduplicationFunction · 0.80

Calls

no outgoing calls

Tested by 4

TestQueueGapFillFunction · 0.64
TestImportDeduplicationFunction · 0.64