Expose several useful Peer fields, for issue 158.

This commit is contained in:
Miron Cuperman 2012-03-19 09:40:17 -07:00
parent a119286b29
commit 7f6d636cec

View File

@ -717,4 +717,32 @@ public class Peer {
public void setDownloadData(boolean downloadData) {
this.downloadData = downloadData;
}
/**
* @return the IP address and port of peer.
*/
public PeerAddress getAddress() {
return address;
}
/**
* @return various version numbers claimed by peer.
*/
public VersionMessage getVersionMessage() {
return versionMessage;
}
/**
* @return the height of the best chain as claimed by peer.
*/
public int getBestHeight() {
return bestHeight;
}
/**
* @return whether the peer is currently connected and the message loop is running.
*/
public boolean isConnected() {
return running;
}
}