Fix sub block height 0 in chia show

This commit is contained in:
Mariano Sorgente
2021-01-26 09:58:57 -08:00
committed by Gene Hoffman
parent 81943ec0f6
commit 4290b91bba
2 changed files with 4 additions and 4 deletions
+4 -3
View File
@@ -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()
-1
View File
@@ -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