mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
fix iterator passed when singleton blockHash added when new block arrives
This commit is contained in:
parent
81f8372611
commit
aec5c3857f
1 changed files with 2 additions and 2 deletions
|
|
@ -216,12 +216,12 @@ func (self *ethProtocol) handle() error {
|
|||
// (or selected as new best peer)
|
||||
if self.blockPool.AddPeer(request.TD, hash, self.id, self.requestBlockHashes, self.requestBlocks, self.protoErrorDisconnect) {
|
||||
called := true
|
||||
iter := func() (hash []byte, ok bool) {
|
||||
iter := func() ([]byte, bool) {
|
||||
if called {
|
||||
called = false
|
||||
return hash, true
|
||||
} else {
|
||||
return
|
||||
return nil, false
|
||||
}
|
||||
}
|
||||
self.blockPool.AddBlockHashes(iter, self.id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue