Package org.bitcoinj.core
Enum Class TransactionConfidence.ConfidenceType
java.lang.Object
java.lang.Enum<TransactionConfidence.ConfidenceType>
org.bitcoinj.core.TransactionConfidence.ConfidenceType
- All Implemented Interfaces:
Serializable,Comparable<TransactionConfidence.ConfidenceType>,Constable
- Enclosing class:
- TransactionConfidence
public static enum TransactionConfidence.ConfidenceType
extends Enum<TransactionConfidence.ConfidenceType>
Describes the state of the transaction in general terms. Properties can be read to learn specifics.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIf BUILDING, then the transaction is included in the best chain and your confidence in it is increasing.If DEAD, then it means the transaction won't confirm unless there is another re-org, because some other transaction is spending one of its inputs.If IN_CONFLICT, then it means there is another transaction (or several other transactions) spending one (or several) of its inputs but nor this transaction nor the other/s transaction/s are included in the best chain.If PENDING, then the transaction is unconfirmed and should be included shortly, as long as it is being announced and is considered valid by the network.If a transaction hasn't been broadcast yet, or there's no record of it, its confidence is UNKNOWN. -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()Returns the enum constant of this class with the specified name.static TransactionConfidence.ConfidenceType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BUILDING
If BUILDING, then the transaction is included in the best chain and your confidence in it is increasing. -
PENDING
If PENDING, then the transaction is unconfirmed and should be included shortly, as long as it is being announced and is considered valid by the network. A pending transaction will be announced if the containing wallet has been attached to a livePeerGroupusingPeerGroup.addWallet(Wallet). You can estimate how likely the transaction is to be included by connecting to a bunch of nodes then measuring how many announce it, usingTransactionConfidence.numBroadcastPeers(). Or if you saw it from a trusted peer, you can assume it's valid and will get mined sooner or later as well. -
DEAD
If DEAD, then it means the transaction won't confirm unless there is another re-org, because some other transaction is spending one of its inputs. Such transactions should be alerted to the user so they can take action, e.g., suspending shipment of goods if they are a merchant. It can also mean that a coinbase transaction has been made dead from it being moved onto a side chain. -
IN_CONFLICT
If IN_CONFLICT, then it means there is another transaction (or several other transactions) spending one (or several) of its inputs but nor this transaction nor the other/s transaction/s are included in the best chain. The other/s transaction/s should be IN_CONFLICT too. IN_CONFLICT can be thought as an intermediary state between a) PENDING and BUILDING or b) PENDING and DEAD. Another common name for this situation is "double spend". -
UNKNOWN
If a transaction hasn't been broadcast yet, or there's no record of it, its confidence is UNKNOWN.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
public int getValue()
-