diff --git a/chia/simulator/block_tools.py b/chia/simulator/block_tools.py index 500fc69a58b5..e7721b057985 100644 --- a/chia/simulator/block_tools.py +++ b/chia/simulator/block_tools.py @@ -965,7 +965,6 @@ def get_consecutive_blocks( block_list.append(full_block) if include_transactions: - prev_tx_height = full_block.height for coin in full_block.get_included_reward_coins(): if coin.puzzle_hash == self.farmer_ph: pending_rewards.append(coin) @@ -979,6 +978,7 @@ def get_consecutive_blocks( if full_block.transactions_generator is not None: tx_block_heights.append(full_block.height) + prev_tx_height = full_block.height blocks_added_this_sub_slot += 1 blocks[full_block.header_hash] = block_record @@ -1259,7 +1259,6 @@ def get_consecutive_blocks( block_list.append(full_block) if include_transactions: - prev_tx_height = full_block.height for coin in full_block.get_included_reward_coins(): if coin.puzzle_hash == self.farmer_ph: pending_rewards.append(coin) @@ -1273,6 +1272,7 @@ def get_consecutive_blocks( if full_block.transactions_generator is not None: tx_block_heights.append(full_block.height) + prev_tx_height = full_block.height blocks_added_this_sub_slot += 1 blocks[full_block.header_hash] = block_record @@ -1755,6 +1755,7 @@ def load_block_list( sub_slot_iters = uint64(constants.SUB_SLOT_ITERS_STARTING) height_to_hash: dict[uint32, bytes32] = {} blocks: dict[bytes32, BlockRecord] = {} + prev_transaction_b_height = uint32(0) for full_block in block_list: if full_block.height != 0: if len(full_block.finished_sub_slots) > 0: @@ -1771,7 +1772,6 @@ def load_block_list( sp_hash = full_block.reward_chain_block.challenge_chain_sp_vdf.output.get_hash() cache = BlockCache(blocks) - prev_transaction_b_height = uint32(0) # TODO: todo_v2_plots required_iters = validate_pospace_and_get_required_iters( constants, @@ -1785,6 +1785,9 @@ def load_block_list( ) assert required_iters is not None + if full_block.is_transaction_block(): + prev_transaction_b_height = full_block.height + blocks[full_block.header_hash] = block_to_block_record( constants, cache,