code: func (i *Inbox) Receive(promise swap.Promise) (*big.Int, error) {
  	ch := promise.(*Cheque)
  
  	defer i.lock.Unlock()
  	i.lock.Lock()
  
  	var sum *big.Int
  	if i.cheque == nil {
  		// the sum is checked against the blockchain once a cheque is received
  		tally, err := i.session.Sent(i.beneficiary)
  		if err != nil {
  			return nil, fmt.Errorf("inbox: error calling backend to set amount: %v", err)
  		}
  		sum = tally
  	} else {
  		sum = i.cheque.Amount
  	}
  
  	amount, err := ch.Verify(i.signer, i.contract, i.beneficiary, sum)
  	var uncashed *big.Int
  	if err == nil {
  		i.cheque = ch
  
  		if i.maxUncashed != nil {
  			uncashed = new(big.Int).Sub(ch.Amount, i.cashed)
  			if i.maxUncashed.Cmp(uncashed) < 0 {
  				i.Cash()
  			}
  		}
  		i.log.Trace("Received cheque in chequebook inbox", "amount", amount, "uncashed", uncashed)
  	}
  
  	return amount, err
  }
docs: // Receive is called to deposit the latest cheque to the incoming Inbox.
  // The given promise must be a *Cheque.