Skip to content

Commit 96c01b4

Browse files
committed
cleanup code
1 parent 4e6e594 commit 96c01b4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/generate_chain.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ async def main(length: int, fill_rate: int, profile: bool, block_refs: bool, out
151151
prev_tx_hash: Optional[bytes32] = None
152152
for bl in blocks:
153153
if bl.is_transaction_block():
154+
reward_coins = bl.get_included_reward_coins()
155+
for coin in reward_coins:
156+
if coin.puzzle_hash in {farmer_puzzlehash, pool_puzzlehash}:
157+
unspent_coins.append(coin)
154158
# Update coin store and mempool with new block
155159
br = BenchBlockRecord(
156160
header_hash=bl.header_hash,
@@ -159,16 +163,13 @@ async def main(length: int, fill_rate: int, profile: bool, block_refs: bool, out
159163
prev_transaction_block_height=prev_tx_height,
160164
prev_transaction_block_hash=prev_tx_hash,
161165
)
162-
await coin_store.new_block(bl.height, block_timestamp, bl.get_included_reward_coins(), [], [])
166+
await coin_store.new_block(bl.height, block_timestamp, reward_coins, [], [])
163167
await mempool_manager.new_peak(br, [])
164168
prev_tx_height = bl.height
165169
prev_tx_hash = bl.header_hash
166170
prev_tx_block = bl # last transaction block
167171

168172
block_timestamp = uint64(block_timestamp + int(time_per_block))
169-
for coin in bl.get_included_reward_coins():
170-
if coin.puzzle_hash in {farmer_puzzlehash, pool_puzzlehash}:
171-
unspent_coins.append(coin)
172173
db.execute(
173174
"INSERT INTO full_blocks VALUES(?, ?, ?, ?, ?)",
174175
(

0 commit comments

Comments
 (0)