Class AbstractPeerDataEventListener
- java.lang.Object
-
- org.bitcoinj.core.listeners.AbstractPeerDataEventListener
-
- All Implemented Interfaces:
BlocksDownloadedEventListener
,ChainDownloadStartedEventListener
,GetDataEventListener
,PeerDataEventListener
,PreMessageReceivedEventListener
- Direct Known Subclasses:
DownloadProgressTracker
@Deprecated public abstract class AbstractPeerDataEventListener extends java.lang.Object implements PeerDataEventListener
Deprecated.Deprecated: implement the more specific event listener interfaces instead to fill out only what you need
-
-
Constructor Summary
Constructors Constructor Description AbstractPeerDataEventListener()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.List<Message>
getData(Peer peer, GetDataMessage m)
Deprecated.Called when a peer receives a getdata message, usually in response to an "inv" being broadcast.void
onBlocksDownloaded(Peer peer, Block block, FilteredBlock filteredBlock, int blocksLeft)
Deprecated.Called on a Peer thread when a block is received.void
onChainDownloadStarted(Peer peer, int blocksLeft)
Deprecated.Called when a download is started with the initial number of blocks to be downloaded.Message
onPreMessageReceived(Peer peer, Message m)
Deprecated.Called when a message is received by a peer, before the message is processed.
-
-
-
Method Detail
-
onBlocksDownloaded
public void onBlocksDownloaded(Peer peer, Block block, @Nullable FilteredBlock filteredBlock, int blocksLeft)
Deprecated.Description copied from interface:BlocksDownloadedEventListener
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.
- Specified by:
onBlocksDownloaded
in interfaceBlocksDownloadedEventListener
- Parameters:
peer
- the peer receiving the blockblock
- the downloaded blockfilteredBlock
- if non-null, the object that wraps the block header passed as the block param.blocksLeft
- the number of blocks left to download
-
onChainDownloadStarted
public void onChainDownloadStarted(Peer peer, int blocksLeft)
Deprecated.Description copied from interface:ChainDownloadStartedEventListener
Called when a download is started with the initial number of blocks to be downloaded.- Specified by:
onChainDownloadStarted
in interfaceChainDownloadStartedEventListener
- Parameters:
peer
- the peer receiving the blockblocksLeft
- the number of blocks left to download
-
onPreMessageReceived
public Message onPreMessageReceived(Peer peer, Message m)
Deprecated.Description copied from interface:PreMessageReceivedEventListener
Called when a message is received by a peer, before the message is processed. The returned message is processed instead. Returning null will cause the message to be ignored by the Peer returning the same message object allows you to see the messages received but not change them. The result from one event listeners callback is passed as "m" to the next, forming a chain.
Note that this will never be called if registered with any executor other than
Threading.SAME_THREAD
- Specified by:
onPreMessageReceived
in interfacePreMessageReceivedEventListener
-
getData
public java.util.List<Message> getData(Peer peer, GetDataMessage m)
Deprecated.Description copied from interface:GetDataEventListener
Called when a peer receives a getdata message, usually in response to an "inv" being broadcast. Return as many items as possible which appear in the
GetDataMessage
, or null if you're not interested in responding.Note that this will never be called if registered with any executor other than
Threading.SAME_THREAD
- Specified by:
getData
in interfaceGetDataEventListener
-
-