Skip to content

Commit

Permalink
πŸ› Avoid parent container KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Apr 18, 2024
1 parent 2ddfc75 commit bd68ebd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion electrumx/server/block_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,11 @@ def populate_dmitem_subtype_specific_fields(self, atomical):
f'parent container not found atomical_id={atomical_id}, '
f'parent_container={parent_container}',
)
atomical['$parent_container_name'] = parent_container['$container']
# The parent container name may not be populated if it's still in the mempool,
# or it's not settled realm request yet. Therefore, check to make sure it exists
# before we can populate this dmitem's container name.
if parent_container.get('$container'):
atomical['$parent_container_name'] = parent_container['$container']
if status == 'verified' and candidate_id == atomical['atomical_id']:
atomical['subtype'] = 'dmitem'
atomical['$dmitem'] = request_dmitem
Expand Down

0 comments on commit bd68ebd

Please sign in to comment.