Skip to content

fix(cli): recognize an initiated swap in post-tx instead of reporting expiry#478

Open
jeffrey701 wants to merge 1 commit into
entrius:testfrom
jeffrey701:fix/post-tx-detect-initiated-swap-473
Open

fix(cli): recognize an initiated swap in post-tx instead of reporting expiry#478
jeffrey701 wants to merge 1 commit into
entrius:testfrom
jeffrey701:fix/post-tx-detect-initiated-swap-473

Conversation

@jeffrey701

Copy link
Copy Markdown

After a swap initiates, the contract clears the reservation row (vote_initiate), so get_miner_reserved_until returns 0 and alw swap post-tx's reserved_until <= current_block check reads it as an expired reservation — it deletes pending_swap.json and tells the user to start over, even though the swap is live. alw view reservation already hedges this case and points at active-swaps; post-tx didn't.

Look up the miner's active swap with resolve_recent_swap_id before assuming expiry. If there's a swap, point the user at it (alw view swap <id> --watch) the same way the post-confirm success path does. Genuine expiry (no swap) is unchanged.

Closes #473

… expiry

After a swap initiates, vote_initiate clears the reservation row, so
get_miner_reserved_until returns 0 and the `reserved_until <= current_block`
guard in `alw swap post-tx` reads it as an expired reservation — it deletes
pending_swap.json and tells the user to start a new swap, severing the link to
the now-live swap.

Before assuming expiry, look up the miner's active swap via
resolve_recent_swap_id. If one exists, point the user at it (swap id +
`alw view swap <id> --watch`), matching the post-confirm success path, rather
than reporting expiry. Genuine expiry (no swap) is unchanged.

Closes entrius#473
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: alw swap post-tx reads an initiated swap as an expired reservation and deletes the local swap record

1 participant