code: func (node *ServerNode) CanSend(maxCost uint64) (time.Duration, float64) {
  	node.lock.RLock()
  	defer node.lock.RUnlock()
  
  	now := node.clock.Now()
  	node.recalcBLE(now)
  	maxCost += uint64(safetyMargin) * node.params.MinRecharge / uint64(fcTimeConst)
  	if maxCost > node.params.BufLimit {
  		maxCost = node.params.BufLimit
  	}
  	if node.bufEstimate >= maxCost {
  		relBuf := float64(node.bufEstimate-maxCost) / float64(node.params.BufLimit)
  		if node.log != nil {
  			node.log.add(now, fmt.Sprintf("canSend  bufEst=%d  maxCost=%d  true  relBuf=%f", node.bufEstimate, maxCost, relBuf))
  		}
  		return 0, relBuf
  	}
  	timeLeft := time.Duration((maxCost - node.bufEstimate) * uint64(fcTimeConst) / node.params.MinRecharge)
  	if node.log != nil {
  		node.log.add(now, fmt.Sprintf("canSend  bufEst=%d  maxCost=%d  false  timeLeft=%v", node.bufEstimate, maxCost, timeLeft))
  	}
  	return timeLeft, 0
  }
docs: // CanSend returns the minimum waiting time required before sending a request
  // with the given maximum estimated cost. Second return value is the relative
  // estimated buffer level after sending the request (divided by BufLimit).