You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
key-wallet: confirm_transaction should refresh TransactionRecord derived metadata on gap-limit rescan #714
Surfaced by CodeRabbit during review of #711. Pre-existing behavior — #711 is a structural-only split and moves this code unchanged.
Problem
ManagedCoreFundsAccount::confirm_transaction is documented to handle "potentially new address matches from gap limit rescans," but for an already-recorded transaction it only updates context and runs update_utxos. The derived fields on the stored TransactionRecord — net_amount, direction, and the per-input/output role flags — are computed once at record_transaction time and never refreshed.
Consequence: a transaction that was first recorded with a partial account_match (e.g. before a gap-limit rescan widened the matching address set) will keep stale wallet metadata even after the rescan re-confirms it.
Suggested fix
When confirm_transaction sees an existing record and the incoming account_match differs from what was used the first time, recompute the derived metadata (re-running the same logic as record_transaction or replacing the entry while preserving transaction_type and context), then continue with the UTXO update.
Activity