Package org.bitcoinj.jni
Class NativeWalletChangeEventListener
- java.lang.Object
-
- org.bitcoinj.jni.NativeWalletChangeEventListener
-
- All Implemented Interfaces:
WalletChangeEventListener
public class NativeWalletChangeEventListener extends java.lang.Object implements WalletChangeEventListener
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
Fields Modifier and Type Field Description long
ptr
-
Constructor Summary
Constructors Constructor Description NativeWalletChangeEventListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onWalletChanged(Wallet wallet)
Designed for GUI applications to refresh their transaction lists.
-
-
-
Method Detail
-
onWalletChanged
public void onWalletChanged(Wallet wallet)
Description copied from interface:WalletChangeEventListener
Designed for GUI applications to refresh their transaction lists. This callback is invoked in the following situations:
- A new block is received (and thus building transactions got more confidence)
- A pending transaction is received
- A pending transaction changes confidence due to some non-new-block related event, such as being announced by more peers or by a double-spend conflict being observed.
- A re-organize occurs. Call occurs only if the re-org modified any of our transactions.
- A new spend is committed to the wallet.
- The wallet is reset and all transactions removed.
When this is called you can refresh the UI contents from the wallet contents. It's more efficient to use this rather than onTransactionConfidenceChanged() + onReorganize() because you only get one callback per block rather than one per transaction per block. Note that this is not called when a key is added.
- Specified by:
onWalletChanged
in interfaceWalletChangeEventListener
-
-