Interface BlocksDownloadedEventListener

  • All Known Subinterfaces:
    BlockchainDownloadEventListener, PeerDataEventListener
    All Known Implementing Classes:

    public interface BlocksDownloadedEventListener

    Implementors can listen to events like blocks being downloaded/transactions being broadcast/connect/disconnects, they can pre-filter messages before they are processed by a Peer or PeerGroup, and they can provide transactions to remote peers when they ask for them.

    • Method Detail

      • onBlocksDownloaded

        void onBlocksDownloaded​(Peer peer,
                                Block block,
                                FilteredBlock filteredBlock,
                                int blocksLeft)

        Called on a Peer thread when a block is received.

        The block may be a Block object that contains transactions, a Block object that is only a header when fast catchup is being used. If set, filteredBlock can be used to retrieve the list of associated transactions.

        peer - the peer receiving the block
        block - the downloaded block
        filteredBlock - if non-null, the object that wraps the block header passed as the block param.
        blocksLeft - the number of blocks left to download