mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-14 11:15:51 +00:00
Expose several useful Peer fields, for issue 158.
This commit is contained in:
parent
a119286b29
commit
7f6d636cec
@ -717,4 +717,32 @@ public class Peer {
|
|||||||
public void setDownloadData(boolean downloadData) {
|
public void setDownloadData(boolean downloadData) {
|
||||||
this.downloadData = 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user