mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-27 17:46:28 -04:00
Prevent double validation of blocks
This commit is contained in:
committed by
Mariano Sorgente
parent
46de03f4d0
commit
d27732d0c3
@@ -840,6 +840,9 @@ class FullNode:
|
||||
sub_block = dataclasses.replace(sub_block, transactions_generator=unf_block.transactions_generator)
|
||||
|
||||
async with self.blockchain.lock:
|
||||
# After acquiring the lock, check again, because another asyncio thread might have added it
|
||||
if self.blockchain.contains_sub_block(header_hash):
|
||||
return None
|
||||
validation_start = time.time()
|
||||
# Tries to add the block to the blockchain
|
||||
pre_validation_results: Optional[
|
||||
|
||||
Reference in New Issue
Block a user