network: use p.LastBlockIndex() in requestBlocks()
Always compare to the best known block index, comparing to the StartHeight is just plain wrong now.
This commit is contained in:
parent
2c4ace022e
commit
f56383e9c8
1 changed files with 1 additions and 1 deletions
|
@ -575,7 +575,7 @@ func (s *Server) requestBlocks(p Peer) error {
|
|||
if len(hashes) > 0 {
|
||||
payload := payload.NewInventory(payload.BlockType, hashes)
|
||||
return p.EnqueueMessage(NewMessage(s.Net, CMDGetData, payload))
|
||||
} else if s.chain.HeaderHeight() < p.Version().StartHeight {
|
||||
} else if s.chain.HeaderHeight() < p.LastBlockIndex() {
|
||||
return s.requestHeaders(p)
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue