code: func (l BlockSpanList) GetMissingBlocks(maxBlock uint) (sorted BlockSpanList) {
  	// it's difficult to know how many spans we will need
  	sorted = make(BlockSpanList, 0)
  
  	lastBlockSpanIndex := -1
  	for _, blockSpan := range l {
  		if int(blockSpan.StartBlock) > lastBlockSpanIndex+1 {
  			sorted = append(
  				sorted,
  				BlockSpan{
  					StartBlock: uint(lastBlockSpanIndex + 1),
  					EndBlock:   blockSpan.StartBlock - 1,
  				},
  			)
  		}
  
  		lastBlockSpanIndex = int(blockSpan.EndBlock)
  	}
  
  	if lastBlockSpanIndex == -1 {
  		sorted = append(
  			sorted,
  			BlockSpan{
  				StartBlock: 0,
  				EndBlock:   maxBlock,
  			},
  		)
  	} else if uint(lastBlockSpanIndex) < maxBlock {
  		sorted = append(
  			sorted,
  			BlockSpan{
  				StartBlock: uint(lastBlockSpanIndex + 1),
  				EndBlock:   maxBlock,
  			},
  		)
  	}
  
  	return sorted
  }
docs: // Creates a list of spans that are missing.
  // note that maxBlock is blockCount-1