code: public void markAsSpent(TransactionInput input) {
          checkState(availableForSpending);
          availableForSpending = false;
          spentBy = input;
          if (parent != null)
              if (log.isDebugEnabled()) log.debug("Marked {}:{} as spent by {}", getParentTransactionHash(), getIndex(), input);
          else
              if (log.isDebugEnabled()) log.debug("Marked floating output as spent by {}", input);
      }
docs: Sets this objects availableForSpending flag to false and the spentBy pointer to the given input.
  If the input is null, it means this output was signed over to somebody else rather than one of our own keys.
  @throws IllegalStateException if the transaction was already marked as spent.