Class 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  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ptr

        public long ptr
    • Constructor Detail

      • NativeWalletChangeEventListener

        public NativeWalletChangeEventListener()
    • 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:

        1. A new block is received (and thus building transactions got more confidence)
        2. A pending transaction is received
        3. 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.
        4. A re-organize occurs. Call occurs only if the re-org modified any of our transactions.
        5. A new spend is committed to the wallet.
        6. 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 interface WalletChangeEventListener