com.google.bitcoin.wallet
Class DefaultRiskAnalysis

java.lang.Object
  extended by com.google.bitcoin.wallet.DefaultRiskAnalysis
All Implemented Interfaces:
RiskAnalysis

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. Outside of specialised protocols you should not encounter non-final transactions.


Nested Class Summary
static class DefaultRiskAnalysis.Analyzer
           
 
Nested classes/interfaces inherited from interface com.google.bitcoin.wallet.RiskAnalysis
RiskAnalysis.Result
 
Field Summary
protected  boolean analyzed
           
protected  List<Transaction> dependencies
           
static DefaultRiskAnalysis.Analyzer FACTORY
           
static BigInteger 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
           
 
Method Summary
 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.
 Transaction isStandard(Transaction tx)
          Checks if a transaction is considered "standard" by the reference client's IsStandardTx and AreInputsStandard functions.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_ANALYSIS_NONDUST_OUTPUT

public static final BigInteger 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. Currently it's 546 satoshis. This is different from Transaction.MIN_NONDUST_OUTPUT because of an upcoming fee change in Bitcoin Core 0.9.


tx

protected final Transaction tx

dependencies

protected final List<Transaction> dependencies

wallet

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 interface RiskAnalysis

isStandard

public Transaction 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.

Returns:
Either null if the transaction is standard, or the first transaction found which is considered nonstandard

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 String toString()
Overrides:
toString in class Object


Copyright © 2014. All rights reserved.