Package org.bitcoinj.jni
Class NativeTransactionConfidenceEventListener
java.lang.Object
org.bitcoinj.jni.NativeTransactionConfidenceEventListener
- All Implemented Interfaces:
TransactionConfidenceEventListener
@Deprecated
public class NativeTransactionConfidenceEventListener
extends Object
implements TransactionConfidenceEventListener
Deprecated.
See https://github.com/bitcoinj/bitcoinj/issues/2465
An event listener that relays events to a native C++ object. A pointer to that object is stored in
this class using JNI on the native side, thus several instances of this can point to different actual
native implementations.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onTransactionConfidenceChanged
(Wallet wallet, Transaction tx) Deprecated.Called when a transaction changes its confidence level.
-
Field Details
-
ptr
public long ptrDeprecated.
-
-
Constructor Details
-
NativeTransactionConfidenceEventListener
public NativeTransactionConfidenceEventListener()Deprecated.
-
-
Method Details
-
onTransactionConfidenceChanged
Deprecated.Description copied from interface:TransactionConfidenceEventListener
Called when a transaction changes its confidence level. You can also attach event listeners to the individual transactions, if you don't care about all of them. Usually you would save the wallet to disk after receiving this callback unless you already set up autosaving.You should pay attention to this callback in case a transaction becomes dead, that is, a transaction you believed to be active (send or receive) becomes overridden by the network. This can happen if:
- You are sharing keys between wallets and accidentally create/broadcast a double spend.
- Somebody is attacking the network and reversing transactions, ie, the user is a victim of fraud.
- A bug: for example you create a transaction, broadcast it but fail to commit it. The
Wallet
will then re-use the same outputs when creating the next spend.
tx.getConfidence().getConfidenceType() == TransactionConfidence.ConfidenceType.DEAD
Note that this callback will be invoked for every transaction in the wallet, for every new block that is received (because the depth has changed). If you want to update a UI view from the contents of the wallet it is more efficient to use onWalletChanged instead.
- Specified by:
onTransactionConfidenceChanged
in interfaceTransactionConfidenceEventListener
-