mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
TransactionConfidence: convert Factory
to interface
This commit is contained in:
parent
dd401ec04a
commit
9d81529eaa
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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){
|
||||||
|
Loading…
Reference in New Issue
Block a user