Skip to content

Commit

Permalink
Bail out earlier if the transaction record has no spend bundle in gen…
Browse files Browse the repository at this point in the history
…erate_new_decentralised_id (#17129)

Bail out earlier if the transaction record has no spend bundle in generate_new_decentralised_id.
  • Loading branch information
AmineKhaldi authored Dec 27, 2023
1 parent ff269b8 commit 4a44043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chia/wallet/did_wallet/did_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,9 @@ async def generate_new_decentralised_id(
origin_id=origin.name(),
)

if tx_record.spend_bundle is None:
return None

genesis_launcher_solution = Program.to([did_puzzle_hash, amount, bytes(0x80)])

launcher_cs = make_spend(launcher_coin, genesis_launcher_puz, genesis_launcher_solution)
Expand All @@ -1305,9 +1308,6 @@ async def generate_new_decentralised_id(
await self.add_parent(eve_coin.parent_coin_info, eve_parent)
await self.add_parent(eve_coin.name(), future_parent)

if tx_record.spend_bundle is None:
return None

# Only want to save this information if the transaction is valid
did_info = DIDInfo(
origin_coin=launcher_coin,
Expand Down

0 comments on commit 4a44043

Please sign in to comment.