3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 07:12:17 +00:00

Update comments/exception message in Peer.getPeerBlockHeightDifference()

This commit is contained in:
Mike Hearn 2012-04-02 13:24:49 +02:00
parent 3bc999a032
commit 2e451800d1

View File

@ -688,8 +688,9 @@ public class Peer {
int chainHeight = (int) conn.getVersionMessage().bestHeight;
if (chainHeight <= 0) {
// This should not happen because we shouldn't have given the user a Peer that is to another client-mode
// node. If that happens it means the user overrode us somewhere.
throw new RuntimeException("Connected to peer advertising negative chain height.");
// node, nor should it be unconnected. If that happens it means the user overrode us somewhere or there is
// a bug in the peer management code.
throw new RuntimeException("Connected to peer advertising zero/negative chain height.");
}
return chainHeight - blockChain.getChainHead().getHeight();
}