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
2 changes: 1 addition & 1 deletion chia/_tests/core/mempool/test_singleton_fast_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,4 +663,4 @@ async def test_double_spend_ff_spend_no_latest_unspent() -> None:
status, error = await make_and_send_spend_bundle(sim, sim_client, [singleton_coin_spend], aggsig=sig)
# It fails validation because it doesn't currently have a latest unspent
assert status == MempoolInclusionStatus.FAILED
assert error == Err.DOUBLE_SPEND
assert error == Err.UNKNOWN_UNSPENT
11 changes: 8 additions & 3 deletions chia/full_node/mempool_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,16 @@ async def validate_spend_bundle(
eligible_for_ff = bool(spend_conds.flags & ELIGIBLE_FOR_FF) and supports_fast_forward(coin_spend)
if eligible_for_ff:
# Make sure the fast forward spend still has a version that is
# still unspent, because if the singleton has been melted, the
# fast forward spend will never become valid.
# still unspent, because if the singleton has been spent in a
# non-FF spend, this fast forward spend will never become valid.
# So treat this as a normal spend, which requires the exact coin
# to exist and be unspent.
# Singletons that were created before the optimization of using
# spent_index will also fail this test, and such spends will
# fall back to be treated as non-FF spends.
lineage_info = await get_unspent_lineage_info_for_puzzle_hash(spend_conds.puzzle_hash)
if lineage_info is None:
return Err.DOUBLE_SPEND, None, []
eligible_for_ff = False

spend_additions = []
for puzzle_hash, amount, _ in spend_conds.create_coin:
Expand Down
Loading