Package org.bitcoinj.wallet
Class DefaultRiskAnalysis
- java.lang.Object
-
- org.bitcoinj.wallet.DefaultRiskAnalysis
-
- All Implemented Interfaces:
RiskAnalysis
public class DefaultRiskAnalysis extends java.lang.Object implements RiskAnalysis
The default risk analysis. Currently, it only is concerned with whether a tx/dependency is non-final or not, and whether a tx/dependency violates the dust rules. Outside of specialised protocols you should not encounter non-final transactions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultRiskAnalysis.Analyzer
static class
DefaultRiskAnalysis.RuleViolation
The reason a transaction is considered non-standard, returned byisStandard(Transaction)
.-
Nested classes/interfaces inherited from interface org.bitcoinj.wallet.RiskAnalysis
RiskAnalysis.Result
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
analyzed
protected java.util.List<Transaction>
dependencies
static DefaultRiskAnalysis.Analyzer
FACTORY
protected Transaction
nonFinal
protected Transaction
tx
protected Wallet
wallet
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RiskAnalysis.Result
analyze()
Transaction
getNonFinal()
Returns the transaction that was found to be non-final, or null.Transaction
getNonStandard()
Returns the transaction that was found to be non-standard, or null.static DefaultRiskAnalysis.RuleViolation
isInputStandard(TransactionInput input)
Checks if the given input passes some of the AreInputsStandard checks.static DefaultRiskAnalysis.RuleViolation
isOutputStandard(TransactionOutput output)
Checks the output to see if the script violates a standardness rule.static DefaultRiskAnalysis.RuleViolation
isStandard(Transaction tx)
Checks if a transaction is considered "standard" by Bitcoin Core's IsStandardTx and AreInputsStandard functions.java.lang.String
toString()
-
-
-
Field Detail
-
tx
protected final Transaction tx
-
dependencies
protected final java.util.List<Transaction> dependencies
-
wallet
@Nullable protected final Wallet wallet
-
nonFinal
protected Transaction nonFinal
-
analyzed
protected boolean analyzed
-
FACTORY
public static DefaultRiskAnalysis.Analyzer FACTORY
-
-
Method Detail
-
analyze
public RiskAnalysis.Result analyze()
- Specified by:
analyze
in interfaceRiskAnalysis
-
isStandard
public static DefaultRiskAnalysis.RuleViolation isStandard(Transaction tx)
Checks if a transaction is considered "standard" by Bitcoin Core's IsStandardTx and AreInputsStandard functions.
Note that this method currently only implements a minimum of checks. More to be added later.
-
isOutputStandard
public static DefaultRiskAnalysis.RuleViolation isOutputStandard(TransactionOutput output)
Checks the output to see if the script violates a standardness rule. Not complete.
-
isInputStandard
public static DefaultRiskAnalysis.RuleViolation isInputStandard(TransactionInput input)
Checks if the given input passes some of the AreInputsStandard checks. Not complete.
-
getNonStandard
@Nullable public Transaction getNonStandard()
Returns the transaction that was found to be non-standard, or null.
-
getNonFinal
@Nullable public Transaction getNonFinal()
Returns the transaction that was found to be non-final, or null.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-