code: func blockDiff(src, tgt []protocol.BlockInfo) ([]protocol.BlockInfo, []protocol.BlockInfo) {
  	if len(tgt) == 0 {
  		return nil, nil
  	}
  
  	if len(src) == 0 {
  		// Copy the entire file
  		return nil, tgt
  	}
  
  	have := make([]protocol.BlockInfo, 0, len(src))
  	need := make([]protocol.BlockInfo, 0, len(tgt))
  
  	for i := range tgt {
  		if i >= len(src) {
  			return have, append(need, tgt[i:]...)
  		}
  		if !bytes.Equal(tgt[i].Hash, src[i].Hash) {
  			// Copy differing block
  			need = append(need, tgt[i])
  		} else {
  			have = append(have, tgt[i])
  		}
  	}
  
  	return have, need
  }
docs: // blockDiff returns lists of common and missing (to transform src into tgt)
  // blocks. Both block lists must have been created with the same block size.