Commit dcf1a198 authored by obscuren's avatar obscuren

moved

parent 8eff550e
...@@ -359,6 +359,12 @@ out: ...@@ -359,6 +359,12 @@ out:
return nil return nil
} }
// Deliver a chunk to the downloader. This is usually done through the BlocksMsg by
// the protocol handler.
func (d *Downloader) DeliverChunk(id string, blocks []*types.Block) {
d.blockCh <- blockPack{id, blocks}
}
func (d *Downloader) AddHashes(id string, hashes []common.Hash) error { func (d *Downloader) AddHashes(id string, hashes []common.Hash) error {
// make sure that the hashes that are being added are actually from the peer // make sure that the hashes that are being added are actually from the peer
// that's the current active peer. hashes that have been received from other // that's the current active peer. hashes that have been received from other
...@@ -422,12 +428,6 @@ func (d *Downloader) AddBlock(id string, block *types.Block, td *big.Int) error ...@@ -422,12 +428,6 @@ func (d *Downloader) AddBlock(id string, block *types.Block, td *big.Int) error
return d.process() return d.process()
} }
// Deliver a chunk to the downloader. This is usually done through the BlocksMsg by
// the protocol handler.
func (d *Downloader) DeliverChunk(id string, blocks []*types.Block) {
d.blockCh <- blockPack{id, blocks}
}
func (d *Downloader) process() error { func (d *Downloader) process() error {
atomic.StoreInt32(&d.processingBlocks, 1) atomic.StoreInt32(&d.processingBlocks, 1)
defer atomic.StoreInt32(&d.processingBlocks, 0) defer atomic.StoreInt32(&d.processingBlocks, 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment