Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions chia/_tests/core/full_node/test_full_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,9 @@ async def test_new_signage_point_caching(
) -> None:
full_node_1, _full_node_2, server_1, server_2, _wallet_a, _wallet_receiver, bt = wallet_nodes
blocks = await full_node_1.get_all_full_blocks()

assert full_node_1.full_node.full_node_store.get_signage_point_by_index_and_cc_output(
bytes32.zeros, full_node_1.full_node.constants.GENESIS_CHALLENGE, uint8(0)
) == SignagePoint(None, None, None, None)
peer = await connect_and_get_peer(server_1, server_2, self_hostname)
blocks = bt.get_consecutive_blocks(3, block_list_input=blocks, skip_slots=2)
await full_node_1.full_node.add_block(blocks[-3])
Expand Down Expand Up @@ -1951,10 +1953,6 @@ async def test_new_signage_point_caching(
is not None
)

assert full_node_1.full_node.full_node_store.get_signage_point_by_index_and_cc_output(
full_node_1.full_node.constants.GENESIS_CHALLENGE, bytes32.zeros, uint8(0)
) == SignagePoint(None, None, None, None)


@pytest.mark.anyio
async def test_slot_catch_up_genesis(
Expand Down
8 changes: 5 additions & 3 deletions chia/full_node/full_node_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,12 @@ def get_signage_point_by_index_and_cc_output(
self, cc_signage_point: bytes32, challenge: bytes32, index: uint8
) -> Optional[SignagePoint]:
assert len(self.finished_sub_slots) >= 1
if cc_signage_point == self.constants.GENESIS_CHALLENGE:
return SignagePoint(None, None, None, None)
for sub_slot, sps, _ in self.finished_sub_slots:
if sub_slot is not None and sub_slot.challenge_chain.get_hash() == challenge:
if sub_slot is not None:
cc_hash = sub_slot.challenge_chain.get_hash()
else:
cc_hash = self.constants.GENESIS_CHALLENGE
if cc_hash == challenge:
if index == 0:
# first SP in the sub slot
return SignagePoint(None, None, None, None)
Expand Down
Loading