public class DefaultRiskAnalysis extends 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(org.bitcoinj.core.Transaction) . |
RiskAnalysis.Result
Modifier and Type | Field and Description |
---|---|
protected boolean |
analyzed |
protected List<Transaction> |
dependencies |
static DefaultRiskAnalysis.Analyzer |
FACTORY |
static Coin |
MIN_ANALYSIS_NONDUST_OUTPUT
Any standard output smaller than this value (in satoshis) will be considered risky, as it's most likely be
rejected by the network.
|
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 the reference client's IsStandardTx and AreInputsStandard
functions.
|
String |
toString() |
public static final Coin MIN_ANALYSIS_NONDUST_OUTPUT
Transaction.MIN_NONDUST_OUTPUT
because of an upcoming fee change in Bitcoin Core 0.9.protected final Transaction tx
protected final List<Transaction> dependencies
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 the reference client'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()
Copyright © 2014. All rights reserved.