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.
Modifier and Type | Class and Description |
---|---|
static class |
DefaultRiskAnalysis.Analyzer |
static class |
DefaultRiskAnalysis.RuleViolation
The reason a transaction is considered non-standard, returned by
isStandard(Transaction) . |
RiskAnalysis.Result
Modifier and Type | Field and Description |
---|---|
protected boolean |
analyzed |
protected java.util.List<Transaction> |
dependencies |
static DefaultRiskAnalysis.Analyzer |
FACTORY |
protected Transaction |
nonFinal |
protected Transaction |
tx |
protected Wallet |
wallet |
Modifier and Type | Method and 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() |
protected final Transaction tx
protected final java.util.List<Transaction> dependencies
@Nullable protected final Wallet wallet
protected Transaction nonFinal
protected boolean analyzed
public static DefaultRiskAnalysis.Analyzer FACTORY
public RiskAnalysis.Result analyze()
analyze
in interface RiskAnalysis
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.
public static DefaultRiskAnalysis.RuleViolation isOutputStandard(TransactionOutput output)
public static DefaultRiskAnalysis.RuleViolation isInputStandard(TransactionInput input)
@Nullable public Transaction getNonStandard()
@Nullable public Transaction getNonFinal()
public java.lang.String toString()
toString
in class java.lang.Object