Skip to content

Commit 6b47ef7

Browse files
committed
add more log
1 parent 1841c88 commit 6b47ef7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

framework/src/main/java/org/tron/core/net/service/handshake/HandshakeService.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,19 @@ public void processHelloMessage(PeerConnection peer, HelloMessage msg) {
9797
}
9898

9999
if (chainBaseManager.getSolidBlockId().getNum() >= msg.getSolidBlockId().getNum()
100-
&& !chainBaseManager.containBlockInMainChain(msg.getSolidBlockId())) {
101-
logger.info("Peer {} different solid block, peer->{}, me->{}",
102-
peer.getInetSocketAddress(),
103-
msg.getSolidBlockId().getString(),
104-
chainBaseManager.getSolidBlockId().getString());
100+
&& !chainBaseManager.containBlockInMainChain(msg.getSolidBlockId())) {
105101
if (chainBaseManager.getNodeType() == NodeType.FULL) {
102+
logger.info("Peer {} solid block is below than we and fork with me, peer->{}, me->{}",
103+
peer.getInetSocketAddress(),
104+
msg.getSolidBlockId().getString(),
105+
chainBaseManager.getSolidBlockId().getString());
106106
peer.disconnect(ReasonCode.FORKED);
107107
} else {
108+
logger.info("Peer {} solid block is below than we and light node doesn't contain the block,"
109+
+ " it's unuseful, peer->{}, me->{}",
110+
peer.getInetSocketAddress(),
111+
msg.getSolidBlockId().getString(),
112+
chainBaseManager.getSolidBlockId().getString());
108113
peer.disconnect(ReasonCode.LIGHT_NODE_SYNC_FAIL);
109114
}
110115
return;

0 commit comments

Comments
 (0)