Fix launcher name definition (#8971)

* Fix launcher name definition

* Minor update per @yostra
This commit is contained in:
Matt Hauff 2021-10-26 16:17:33 -07:00 committed by GitHub
parent 0952c29681
commit 0e941f5144
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -890,14 +890,13 @@ class WalletNode:
assert self.wallet_state_manager is not None
additional_coin_spends: List[CoinSpend] = []
if len(removed_coins) > 0:
removed_coin_ids = set([coin.name() for coin in removed_coins])
all_added_coins = await self.get_additions(peer, block, [], get_all_additions=True)
assert all_added_coins is not None
if all_added_coins is not None:
all_added_coin_parents = [c.parent_coin_info for c in all_added_coins]
for coin in all_added_coins:
# This searches specifically for a launcher being created, and adds the solution of the launcher
if coin.puzzle_hash == SINGLETON_LAUNCHER_HASH and coin.parent_coin_info in removed_coin_ids:
if coin.puzzle_hash == SINGLETON_LAUNCHER_HASH and coin.name() in all_added_coin_parents:
cs: CoinSpend = await self.fetch_puzzle_solution(peer, block.height, coin)
additional_coin_spends.append(cs)
# Apply this coin solution, which might add things to interested list