code: func (swap *Swap) Receive(units int, promise Promise) error {
  	if units <= 0 {
  		return fmt.Errorf("invalid units: %v <= 0", units)
  	}
  
  	price := new(big.Int).SetInt64(int64(units))
  	price.Mul(price, swap.local.SellAt)
  
  	amount, err := swap.In.Receive(promise)
  
  	if err != nil {
  		err = fmt.Errorf("invalid promise: %v", err)
  	} else if price.Cmp(amount) != 0 {
  		// verify amount = units * unit sale price
  		return fmt.Errorf("invalid amount: %v = %v * %v (units sent in msg * agreed sale unit price) != %v (signed in cheque)", price, units, swap.local.SellAt, amount)
  	}
  	if err != nil {
  		log.Trace(fmt.Sprintf("<%v> invalid promise (amount: %v, channel: %v): %v", swap.proto, amount, swap.In, err))
  		return err
  	}
  
  	// credit remote peer with units
  	swap.Add(-units)
  	log.Trace(fmt.Sprintf("<%v> received promise (amount: %v, channel: %v): %v", swap.proto, amount, swap.In, promise))
  
  	return nil
  }
docs: // Receive (units, promise) is called by the protocol when a payment msg is received
  // returns error if promise is invalid.