mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
AddBlockHashes call uses lazy rlp decoding so it cannot be async since message is discarded by protocol
This commit is contained in:
parent
a7ac361c8f
commit
9ab3530df3
1 changed files with 102 additions and 102 deletions
|
|
@ -322,10 +322,10 @@ func (self *BlockPool) AddBlockHashes(next func() ([]byte, bool), peerId string)
|
|||
// peer is still the best
|
||||
poolLogger.Debugf("adding hashes for best peer %s", peerId)
|
||||
|
||||
self.wg.Add(1)
|
||||
self.procWg.Add(1)
|
||||
// self.wg.Add(1)
|
||||
// self.procWg.Add(1)
|
||||
|
||||
go func() {
|
||||
// go func() {
|
||||
var size, n int
|
||||
var hash []byte
|
||||
var ok bool = true
|
||||
|
|
@ -333,7 +333,7 @@ func (self *BlockPool) AddBlockHashes(next func() ([]byte, bool), peerId string)
|
|||
var entry *poolEntry
|
||||
var nodes []*poolNode
|
||||
|
||||
LOOP:
|
||||
LOOP:
|
||||
// iterate using next (rlp stream lazy decoder) feeding hashesC
|
||||
for hash, ok = next(); ok; hash, ok = next() {
|
||||
n++
|
||||
|
|
@ -430,10 +430,10 @@ func (self *BlockPool) AddBlockHashes(next func() ([]byte, bool), peerId string)
|
|||
peer.addSection(section.top.hash, section)
|
||||
section.controlC <- true
|
||||
}
|
||||
self.procWg.Done()
|
||||
self.wg.Done()
|
||||
// self.procWg.Done()
|
||||
// self.wg.Done()
|
||||
|
||||
}()
|
||||
// }()
|
||||
}
|
||||
|
||||
func name(hash []byte) (name string) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue