Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions chia/simulator/block_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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,
Expand All @@ -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,
Expand Down
Loading