TransactionConfidence: convert Factory to interface

This commit is contained in:
Sean Gilligan 2023-08-22 13:20:59 -07:00 committed by Andreas Schildbach
parent dd401ec04a
commit 9d81529eaa
2 changed files with 3 additions and 5 deletions

View File

@ -73,10 +73,8 @@ import static org.bitcoinj.base.internal.Preconditions.checkState;
*/ */
public class TransactionConfidence { public class TransactionConfidence {
@VisibleForTesting @VisibleForTesting
static class Factory { interface Factory {
public TransactionConfidence createConfidence(Sha256Hash hash) { TransactionConfidence createConfidence(Sha256Hash hash);
return new TransactionConfidence(hash);
}
} }
/** /**

View File

@ -68,7 +68,7 @@ public class TxConfidenceTable {
* @param size Max number of transactions to track. The table will fill up to this size then stop growing. * @param size Max number of transactions to track. The table will fill up to this size then stop growing.
*/ */
public TxConfidenceTable(final int size) { public TxConfidenceTable(final int size) {
this(size, new TransactionConfidence.Factory()); this(size, TransactionConfidence::new);
} }
TxConfidenceTable(final int size, TransactionConfidence.Factory confidenceFactory){ TxConfidenceTable(final int size, TransactionConfidence.Factory confidenceFactory){