public LinkedList<TransactionOutput> calculateAllSpendCandidates(boolean excludeImmatureCoinbases){
  lock.lock();
  try {
    LinkedList<TransactionOutput> candidates=Lists.newLinkedList();
    for (    Transaction tx : Iterables.concat(unspent.values(),pending.values())) {
      if (excludeImmatureCoinbases && !tx.isMature())       continue;
      for (      TransactionOutput output : tx.getOutputs()) {
        if (!output.isAvailableForSpending())         continue;
        if (!output.isMine(this))         continue;
        candidates.add(output);
      }
    }
    return candidates;
  }
  finally {
    lock.unlock();
  }
}

public LinkedList < TransactionOutput > calculateAllSpendCandidates ( boolean excludeImmatureCoinbases ) { lock . lock ( ) ; try { LinkedList < TransactionOutput > candidates = Lists . newLinkedList ( ) ; for ( Transaction tx : Iterables . concat ( unspent . values ( ) , pending . values ( ) ) ) { if ( excludeImmatureCoinbases && ! tx . isMature ( ) ) continue ; for ( TransactionOutput output : tx . getOutputs ( ) ) { if ( ! output . isAvailableForSpending ( ) ) continue ; if ( ! output . isMine ( this ) ) continue ; candidates . add ( output ) ; } } return candidates ; } finally { lock . unlock ( ) ; } }
returns a list of all possible outputs we could possibly spend , potentially even including immature coinbases ( which the protocol may forbid us from spending ) . in other words , return all outputs that this wallet holds keys for and which are not already marked as spent .
