test_class.declarator: params = UnitTestParams.get()
test_class.modifier: private static final
test_class.original_string: private static final NetworkParameters params = UnitTestParams.get();
test_class.type: NetworkParameters
test_class.var_name: params
test_class.file: core/src/test/java/com/google/bitcoin/wallet/DefaultCoinSelectorTest.java
test_class.identifier: DefaultCoinSelectorTest
test_class.superclass: extends TestWithWallet
test_case.body: @Test
      public void selectable() throws Exception {
          Transaction t;
          t = new Transaction(params);
          t.getConfidence().setConfidenceType(TransactionConfidence.ConfidenceType.PENDING);
          assertFalse(DefaultCoinSelector.isSelectable(t));
          t.getConfidence().setSource(TransactionConfidence.Source.SELF);
          assertFalse(DefaultCoinSelector.isSelectable(t));
          t.getConfidence().markBroadcastBy(new PeerAddress(InetAddress.getByName("1.2.3.4")));
          assertFalse(DefaultCoinSelector.isSelectable(t));
          t.getConfidence().markBroadcastBy(new PeerAddress(InetAddress.getByName("5.6.7.8")));
          assertTrue(DefaultCoinSelector.isSelectable(t));
          t = new Transaction(params);
          t.getConfidence().setConfidenceType(TransactionConfidence.ConfidenceType.BUILDING);
          assertTrue(DefaultCoinSelector.isSelectable(t));
          t = new Transaction(RegTestParams.get());
          t.getConfidence().setConfidenceType(TransactionConfidence.ConfidenceType.PENDING);
          t.getConfidence().setSource(TransactionConfidence.Source.SELF);
          assertTrue(DefaultCoinSelector.isSelectable(t));
      }
test_case.class_method_signature: DefaultCoinSelectorTest.selectable()
test_case.full_signature: @Test public void selectable()
test_case.identifier: selectable
test_case.invocations: setConfidenceType getConfidence assertFalse isSelectable setSource getConfidence assertFalse isSelectable markBroadcastBy getConfidence getByName assertFalse isSelectable markBroadcastBy getConfidence getByName assertTrue isSelectable setConfidenceType getConfidence assertTrue isSelectable get setConfidenceType getConfidence setSource getConfidence assertTrue isSelectable
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void selectable()
focal_class.file: core/src/main/java/com/google/bitcoin/wallet/DefaultCoinSelector.java
focal_class.identifier: DefaultCoinSelector
focal_class.interfaces: implements CoinSelector
focal_class.class_method_signature: DefaultCoinSelector.select(BigInteger biTarget, LinkedList<TransactionOutput> candidates)
focal_class.full_signature: public CoinSelection select(BigInteger biTarget, LinkedList<TransactionOutput> candidates)
focal_class.identifier: select
focal_class.modifiers: public
focal_class.parameters: (BigInteger biTarget, LinkedList<TransactionOutput> candidates)
focal_class.return: CoinSelection
focal_class.signature: CoinSelection select(BigInteger biTarget, LinkedList<TransactionOutput> candidates)
focal_class.class_method_signature: DefaultCoinSelector.sortOutputs(ArrayList<TransactionOutput> outputs)
focal_class.full_signature: @VisibleForTesting static void sortOutputs(ArrayList<TransactionOutput> outputs)
focal_class.identifier: sortOutputs
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (ArrayList<TransactionOutput> outputs)
focal_class.return: void
focal_class.signature: void sortOutputs(ArrayList<TransactionOutput> outputs)
focal_class.class_method_signature: DefaultCoinSelector.shouldSelect(Transaction tx)
focal_class.full_signature: protected boolean shouldSelect(Transaction tx)
focal_class.identifier: shouldSelect
focal_class.modifiers: protected
focal_class.parameters: (Transaction tx)
focal_class.return: boolean
focal_class.signature: boolean shouldSelect(Transaction tx)
focal_class.class_method_signature: DefaultCoinSelector.isSelectable(Transaction tx)
focal_class.full_signature: public static boolean isSelectable(Transaction tx)
focal_class.identifier: isSelectable
focal_class.modifiers: public static
focal_class.parameters: (Transaction tx)
focal_class.return: boolean
focal_class.signature: boolean isSelectable(Transaction tx)
focal_method.body: public static boolean isSelectable(Transaction tx) {
          // Only pick chain-included transactions, or transactions that are ours and pending.
          TransactionConfidence confidence = tx.getConfidence();
          TransactionConfidence.ConfidenceType type = confidence.getConfidenceType();
          return type.equals(TransactionConfidence.ConfidenceType.BUILDING) ||
  
                 type.equals(TransactionConfidence.ConfidenceType.PENDING) &&
                 confidence.getSource().equals(TransactionConfidence.Source.SELF) &&
                 // In regtest mode we expect to have only one peer, so we won't see transactions propagate.
                 // TODO: The value 1 below dates from a time when transactions we broadcast *to* were counted, set to 0
                 (confidence.numBroadcastPeers() > 1 || tx.getParams() == RegTestParams.get());
      }
focal_method.class_method_signature: DefaultCoinSelector.isSelectable(Transaction tx)
focal_method.full_signature: public static boolean isSelectable(Transaction tx)
focal_method.identifier: isSelectable
focal_method.invocations: getConfidence getConfidenceType equals equals equals getSource numBroadcastPeers getParams get
focal_method.modifiers: public static
focal_method.parameters: (Transaction tx)
focal_method.return: boolean
focal_method.signature: boolean isSelectable(Transaction tx)