File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
chainbase/src/main/java/org/tron/core
framework/src/main/java/org/tron/core/net Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,9 @@ public boolean containBlockInMainChain(BlockId blockId) {
362
362
}
363
363
}
364
364
365
+ public BlockCapsule getKhaosDbHead (){
366
+ return this .khaosDb .getHead ();
367
+ }
365
368
366
369
/**
367
370
* Get a BlockCapsule by id.
Original file line number Diff line number Diff line change @@ -146,6 +146,10 @@ public BlockId getHeadBlockId() {
146
146
return chainBaseManager .getHeadBlockId ();
147
147
}
148
148
149
+ public BlockId getKhaosDbHeadBlockId () {
150
+ return chainBaseManager .getKhaosDbHead ().getBlockId ();
151
+ }
152
+
149
153
public BlockId getSolidBlockId () {
150
154
return chainBaseManager .getSolidBlockId ();
151
155
}
Original file line number Diff line number Diff line change @@ -169,7 +169,8 @@ private LinkedList<BlockId> getBlockChainSummary(PeerConnection peer) throws P2p
169
169
if (beginBlockId .getNum () == 0 ) {
170
170
highNoFork = high = tronNetDelegate .getHeadBlockId ().getNum ();
171
171
} else {
172
- if (tronNetDelegate .containBlockInMainChain (beginBlockId )) {
172
+ if (tronNetDelegate .getKhaosDbHeadBlockId ().equals (beginBlockId )
173
+ || tronNetDelegate .containBlockInMainChain (beginBlockId )) {
173
174
highNoFork = high = beginBlockId .getNum ();
174
175
} else {
175
176
forkList = tronNetDelegate .getBlockChainHashesOnFork (beginBlockId );
You can’t perform that action at this time.
0 commit comments