Package | Description |
---|---|
org.bitcoinj.core |
The core package contains classes for network messages like
Block and
Transaction , peer connectivity via PeerGroup ,
block chain management and the Wallet class. |
org.bitcoinj.jni | |
org.bitcoinj.testing |
Various utilities for writing unit tests: also useful for testing your own code and apps that build on top of
bitcoinj.
|
Modifier and Type | Method and Description |
---|---|
Peer |
PeerGroup.connectTo(InetSocketAddress address)
Connect to a peer by creating a channel to the destination address.
|
protected Peer |
PeerGroup.connectTo(PeerAddress address,
boolean incrementMaxConnections,
int connectTimeoutMillis)
Creates a version message to send, constructs a Peer object and attempts to connect it.
|
Peer |
PeerGroup.connectToLocalHost()
Helper for forcing a connection to localhost.
|
Peer |
PeerGroup.getDownloadPeer()
Returns the currently selected download peer.
|
protected Peer |
PeerGroup.selectDownloadPeer(List<Peer> peers)
Given a list of Peers, return a Peer to be used as the download peer.
|
Modifier and Type | Method and Description |
---|---|
List<Peer> |
PeerGroup.findPeersOfAtLeastVersion(long protocolVersion)
Returns a mutable array list of peers that implement the given protocol version or better.
|
List<Peer> |
PeerGroup.getConnectedPeers()
Returns a newly allocated list containing the currently connected peers.
|
ListenableFuture<Peer> |
Peer.getConnectionOpenFuture()
Provides a ListenableFuture that can be used to wait for the socket to connect.
|
List<Peer> |
PeerGroup.getPendingPeers()
Returns a list containing Peers that did not complete connection yet.
|
ListenableFuture<Peer> |
Peer.getVersionHandshakeFuture() |
ListenableFuture<List<Peer>> |
PeerGroup.waitForPeers(int numPeers)
Returns a future that is triggered when the number of connected peers is equal to the given number of
peers.
|
ListenableFuture<List<Peer>> |
PeerGroup.waitForPeersOfVersion(int numPeers,
long protocolVersion)
Returns a future that is triggered when there are at least the requested number of connected peers that support
the given protocol version or higher.
|
Modifier and Type | Method and Description |
---|---|
List<Message> |
PeerEventListener.getData(Peer peer,
GetDataMessage m)
Called when a peer receives a getdata message, usually in response to an "inv" being broadcast.
|
List<Message> |
AbstractPeerEventListener.getData(Peer peer,
GetDataMessage m) |
protected void |
PeerGroup.handleNewPeer(Peer peer) |
protected void |
PeerGroup.handlePeerDeath(Peer peer) |
void |
PeerEventListener.onBlocksDownloaded(Peer peer,
Block block,
int blocksLeft)
Called on a Peer thread when a block is received.
|
void |
DownloadListener.onBlocksDownloaded(Peer peer,
Block block,
int blocksLeft) |
void |
AbstractPeerEventListener.onBlocksDownloaded(Peer peer,
Block block,
int blocksLeft) |
void |
PeerEventListener.onChainDownloadStarted(Peer peer,
int blocksLeft)
Called when a download is started with the initial number of blocks to be downloaded.
|
void |
DownloadListener.onChainDownloadStarted(Peer peer,
int blocksLeft) |
void |
AbstractPeerEventListener.onChainDownloadStarted(Peer peer,
int blocksLeft) |
void |
PeerEventListener.onPeerConnected(Peer peer,
int peerCount)
Called when a peer is connected.
|
void |
AbstractPeerEventListener.onPeerConnected(Peer peer,
int peerCount) |
void |
PeerEventListener.onPeerDisconnected(Peer peer,
int peerCount)
Called when a peer is disconnected.
|
void |
AbstractPeerEventListener.onPeerDisconnected(Peer peer,
int peerCount) |
Message |
PeerEventListener.onPreMessageReceived(Peer peer,
Message m)
Called when a message is received by a peer, before the message is processed.
|
Message |
AbstractPeerEventListener.onPreMessageReceived(Peer peer,
Message m) |
void |
PeerEventListener.onTransaction(Peer peer,
Transaction t)
Called when a new transaction is broadcast over the network.
|
void |
AbstractPeerEventListener.onTransaction(Peer peer,
Transaction t) |
Transaction |
Wallet.sendCoins(Peer peer,
Wallet.SendRequest request)
Sends coins to the given address, via the given
Peer . |
Modifier and Type | Method and Description |
---|---|
static int |
PeerGroup.getMostCommonChainHeight(List<Peer> peers)
Returns most commonly reported chain height from the given list of
Peer s. |
protected Peer |
PeerGroup.selectDownloadPeer(List<Peer> peers)
Given a list of Peers, return a Peer to be used as the download peer.
|
Modifier and Type | Method and Description |
---|---|
List<Message> |
NativePeerEventListener.getData(Peer peer,
GetDataMessage m) |
void |
NativePeerEventListener.onBlocksDownloaded(Peer peer,
Block block,
int blocksLeft) |
void |
NativePeerEventListener.onChainDownloadStarted(Peer peer,
int blocksLeft) |
void |
NativePeerEventListener.onPeerConnected(Peer peer,
int peerCount) |
void |
NativePeerEventListener.onPeerDisconnected(Peer peer,
int peerCount) |
Message |
NativePeerEventListener.onPreMessageReceived(Peer peer,
Message m) |
void |
NativePeerEventListener.onTransaction(Peer peer,
Transaction t) |
Modifier and Type | Field and Description |
---|---|
Peer |
InboundMessageQueuer.peer |
Modifier and Type | Method and Description |
---|---|
protected Peer |
TestWithNetworkConnections.peerOf(InboundMessageQueuer ch) |
Modifier and Type | Method and Description |
---|---|
protected void |
TestWithNetworkConnections.closePeer(Peer peer) |
protected InboundMessageQueuer |
TestWithNetworkConnections.connect(Peer peer,
VersionMessage versionMessage) |
Copyright © 2014. All rights reserved.