mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
A rested maker carries an 8-byte-truncated User (from persist.go userToUint64); a fresh taker carries the full 16-byte identity. The marketable matcher's raw User== self-trade check missed the same-account self-cross, desyncing the int/ float quantity lanes -> maker reserve drained + orderuser row deleted -> later cross stranded settlement -> conservation broke. Add selfTradeKey() (one fold, used by both place + marketable paths) and skip-and-cancel the self-maker leg. settle.go arithmetic untouched. seed 4242 re-included + conserves.