Skip to content

Revert "fix(transaction): get_out_point reverses tx hash (#9)" - #13

Merged
markin-io merged 1 commit into
masterfrom
fix/revert-out-point-endianness-change
Jan 4, 2023
Merged

Revert "fix(transaction): get_out_point reverses tx hash (#9)"#13
markin-io merged 1 commit into
masterfrom
fix/revert-out-point-endianness-change

Conversation

@markin-io

Copy link
Copy Markdown
Contributor

This reverts commit 6092d58.

@markin-io
markin-io merged commit 51548a4 into master Jan 4, 2023
@markin-io
markin-io deleted the fix/revert-out-point-endianness-change branch July 5, 2023 11:58
shumkov pushed a commit that referenced this pull request Feb 28, 2025
romchornyi pushed a commit that referenced this pull request Aug 13, 2026
Three findings, one design gap: the sweep was attached to *account*
processing, but "a competing spend just became provably dead" is a
wallet-wide fact the moment any account observes a final spend.

**#8 — the sweep never ran when the winner looked irrelevant.**
`check_core_transaction` returns before touching any account, and
relevance is computed from matching outputs and from inputs still in
`utxos` — but a recorded loser already removed the shared input. So a
winner that spends our coin and pays only external addresses matches
nothing, and the loser stayed credited. Worse, as trusted self-send
change it counts as *confirmed* and is spendable. The sweep now runs
before that gate, next to `record_observed_spends`, which is
unconditional for the same reason.

**#13 — a loser in a sibling account survived.** The per-account sweep
only visited `result.affected_accounts`, i.e. the winner's. Pooled
funding routinely puts the loser's change elsewhere — the shape this
PR's own commits call normal for asset locks. `ManagedWalletInfo::
sweep_conflicts` now asks every funds account.

**#9 — the IS-lock sweep was dead code.** The live pipeline reaches
`process_instant_send_lock` → `mark_instant_send_utxos`, which marks
UTXOs and rewrites context and had no sweep at all; the branch I had
added in `check_core_transaction` is only reachable on a first sighting
that already carries the lock. The sweep now hangs off
`mark_instant_send_utxos`, and the superseded per-account entry point
is gone.

Both new tests were confirmed to fail with the wallet-level sweep
disabled.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants