3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +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; int chainHeight = (int) conn.getVersionMessage().bestHeight;
if (chainHeight <= 0) { if (chainHeight <= 0) {
// This should not happen because we shouldn't have given the user a Peer that is to another client-mode // 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. // node, nor should it be unconnected. If that happens it means the user overrode us somewhere or there is
throw new RuntimeException("Connected to peer advertising negative chain height."); // a bug in the peer management code.
throw new RuntimeException("Connected to peer advertising zero/negative chain height.");
} }
return chainHeight - blockChain.getChainHead().getHeight(); return chainHeight - blockChain.getChainHead().getHeight();
} }