network: fix requestBlocks() for (headers == blocks + 1)
In the very specific case when the list of headers received is exactly one block ahead of the chain of full blocks requestBlocks() failed to generate request to get the next full block.
This commit is contained in:
parent
3c40a53c4d
commit
9617a6f9e9
1 changed files with 1 additions and 1 deletions
|
@ -330,7 +330,7 @@ func (s *Server) requestBlocks(p Peer) error {
|
|||
hashStart = s.chain.BlockHeight() + 1
|
||||
headerHeight = s.chain.HeaderHeight()
|
||||
)
|
||||
for hashStart < headerHeight && len(hashes) < maxBlockBatch {
|
||||
for hashStart <= headerHeight && len(hashes) < maxBlockBatch {
|
||||
hash := s.chain.GetHeaderHash(int(hashStart))
|
||||
hashes = append(hashes, hash)
|
||||
hashStart++
|
||||
|
|
Loading…
Reference in a new issue