AddBlockHashes call uses lazy rlp decoding so it cannot be async since message is discarded by protocol

This commit is contained in:
zelig 2015-01-03 03:41:29 +00:00
parent b768d14620
commit 60d73fa261

View file

@ -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
@ -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) {