mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-27 17:46:28 -04:00
Fix sub block height 0 in chia show
This commit is contained in:
committed by
Gene Hoffman
parent
81943ec0f6
commit
4290b91bba
@@ -258,6 +258,10 @@ class FullNode:
|
||||
peer: peer that sent the message
|
||||
|
||||
"""
|
||||
|
||||
# Store this peak/peer combination in case we want to sync to it, and to keep track of peers
|
||||
self.sync_store.add_peak_peer(request.header_hash, peer.peer_node_id, request.weight, request.sub_block_height)
|
||||
|
||||
if self.blockchain.contains_sub_block(request.header_hash):
|
||||
return None
|
||||
|
||||
@@ -267,9 +271,6 @@ class FullNode:
|
||||
if peak is not None and peak.weight > request.weight:
|
||||
return None
|
||||
|
||||
# Store this peak/peer combination in case we want to sync to it
|
||||
self.sync_store.add_peak_peer(request.header_hash, peer.peer_node_id, request.weight, request.sub_block_height)
|
||||
|
||||
if self.sync_store.get_sync_mode():
|
||||
# If peer connects while we are syncing, check if they have the block we are syncing towards
|
||||
peak_sync_hash = self.sync_store.get_sync_target_hash()
|
||||
|
||||
@@ -440,7 +440,6 @@ class WalletBlockchain(BlockchainInterface):
|
||||
blocks_to_remove = self.__sub_heights_in_cache.get(uint32(sub_height), None)
|
||||
while blocks_to_remove is not None and sub_height >= 0:
|
||||
for header_hash in blocks_to_remove:
|
||||
log.debug(f"delete {header_hash} height {sub_height} from sub blocks")
|
||||
del self.__sub_blocks[header_hash]
|
||||
del self.__sub_heights_in_cache[uint32(sub_height)] # remove height from heights in cache
|
||||
|
||||
|
||||
Reference in New Issue
Block a user