Skip to content

fix handling of conflicting order transactions in the wallet#2045

Merged
OBorce merged 2 commits intomasterfrom
fix/wallet-conflicting-orders
Apr 24, 2026
Merged

fix handling of conflicting order transactions in the wallet#2045
OBorce merged 2 commits intomasterfrom
fix/wallet-conflicting-orders

Conversation

@OBorce
Copy link
Copy Markdown
Contributor

@OBorce OBorce commented Apr 23, 2026

Fixes #2043

Any confirmed Freeze order transaction will now mark any unconfirmed Fill or Freeze order transaction for the same order as conflicting.
Similar for Conclude order it will mark any unconfirmed Fill, Freeze or Conclude order transactions as conflicting.

@OBorce OBorce force-pushed the fix/wallet-conflicting-orders branch from 35a466e to 2f2522f Compare April 23, 2026 08:00
Comment thread wallet/src/account/output_cache/mod.rs Outdated
Comment on lines +2106 to +2107
cmd_tag: OrderAccountCommandTag,
order_id: OrderId,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name them confirmed_tx_cmd_tag and confirmed_tx_order_id?

assert!(output_cache.orders[&order_id].is_concluded);

// A *different* confirmed conclude tx for the same order arrives.
// update_conflicting_txs must mark the unconfirmed one as Conflicted.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"unconfirmed one" - there are multiple txs that are marked as Conflicted here

)
.unwrap();

assert!(output_cache.orders[&order_id].is_concluded);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For completeness, I'd check the state of is_frozen too.

Same in the second test - whenever you check is_frozen, it's better to also check that is_concluded is not affected.

@ImplOfAnImpl
Copy link
Copy Markdown
Contributor

Plz also update the changelog

@OBorce OBorce merged commit 69b90e9 into master Apr 24, 2026
20 checks passed
@OBorce OBorce deleted the fix/wallet-conflicting-orders branch April 24, 2026 07:40
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.

Wallet fails to record confirmed ConcludeOrder when a competing unconfirmed conclude exists

2 participants