File tree Expand file tree Collapse file tree
chainbase/src/main/java/org/tron/core
framework/src/main/java/org/tron/core/net Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -362,6 +362,9 @@ public boolean containBlockInMainChain(BlockId blockId) {
362362 }
363363 }
364364
365+ public BlockCapsule getKhaosDbHead (){
366+ return this .khaosDb .getHead ();
367+ }
365368
366369 /**
367370 * Get a BlockCapsule by id.
Original file line number Diff line number Diff line change @@ -146,6 +146,10 @@ public BlockId getHeadBlockId() {
146146 return chainBaseManager .getHeadBlockId ();
147147 }
148148
149+ public BlockId getKhaosDbHeadBlockId () {
150+ return chainBaseManager .getKhaosDbHead ().getBlockId ();
151+ }
152+
149153 public BlockId getSolidBlockId () {
150154 return chainBaseManager .getSolidBlockId ();
151155 }
Original file line number Diff line number Diff line change @@ -169,7 +169,8 @@ private LinkedList<BlockId> getBlockChainSummary(PeerConnection peer) throws P2p
169169 if (beginBlockId .getNum () == 0 ) {
170170 highNoFork = high = tronNetDelegate .getHeadBlockId ().getNum ();
171171 } else {
172- if (tronNetDelegate .containBlockInMainChain (beginBlockId )) {
172+ if (tronNetDelegate .getKhaosDbHeadBlockId ().equals (beginBlockId )
173+ || tronNetDelegate .containBlockInMainChain (beginBlockId )) {
173174 highNoFork = high = beginBlockId .getNum ();
174175 } else {
175176 forkList = tronNetDelegate .getBlockChainHashesOnFork (beginBlockId );
You can’t perform that action at this time.
0 commit comments