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 classDefaultRiskAnalysis.Analyzerstatic classDefaultRiskAnalysis.RuleViolationThe 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 booleananalyzedprotected java.util.List<Transaction>dependenciesstatic DefaultRiskAnalysis.AnalyzerFACTORYprotected TransactionnonFinalprotected Transactiontxprotected Walletwallet
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RiskAnalysis.Resultanalyze()TransactiongetNonFinal()Returns the transaction that was found to be non-final, or null.TransactiongetNonStandard()Returns the transaction that was found to be non-standard, or null.static DefaultRiskAnalysis.RuleViolationisInputStandard(TransactionInput input)Checks if the given input passes some of the AreInputsStandard checks.static DefaultRiskAnalysis.RuleViolationisOutputStandard(TransactionOutput output)Checks the output to see if the script violates a standardness rule.static DefaultRiskAnalysis.RuleViolationisStandard(Transaction tx)Checks if a transaction is considered "standard" by Bitcoin Core's IsStandardTx and AreInputsStandard functions.java.lang.StringtoString()
-
-
-
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:
analyzein 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:
toStringin classjava.lang.Object
-
-