Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Add warning of witness presistence race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
carver committed Nov 20, 2020
1 parent 24b1d54 commit 1c2d53c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions trinity/protocol/wit/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def persist_witness_hashes(
recent_blocks_with_witnesses)

try:
# Note: if this call is converted to async, watch out for the race
# condition of two persists that interleave. It would be
# possible for one to overwrite the other. For now, the synchronous
# approach means that that isn't a concern.
existing_hashes = self.get_witness_hashes(block_hash)
except WitnessHashesUnavailable:
existing_hashes = ()
Expand Down

0 comments on commit 1c2d53c

Please sign in to comment.