fix(exchange-tx): notify Scrypt deposit only after bank_tx confirms money left#3778
Merged
Merged
Conversation
This was referenced May 27, 2026
…oney left Scrypt deposit requests were sent at bank payment transmission time, before the money actually arrived. Scrypt then created pending deposits that could take >24h to reconcile. A cleanup cron marked them failed after 24h, racing against Scrypt's reconciliation and causing ~100k CHF double-count in the financial log. Move the Scrypt deposit notification from the transmit step to the searchOutgoingBankTx completion step, where the matching bank_tx confirms the money left. Remove the stale deposit cleanup cron — no longer needed.
c0ccefc to
eef5b3c
Compare
7 tasks
TaprootFreak
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pending.toScrypt+ same amount in live balance)Fix
searchOutgoingBankTx, where the matching bank_tx confirms the money leftcleanupStalePendingDepositscron — no longer needed since deposits won't be created prematurelyRoot cause investigation
fetchAllreturns the completed deposit withStatus: "Completed"but under a differentClReqIDthan the original pending recordpendingin prod — the sync picked it up and resolved tookwithin one cyclefailedTest plan
pending, verify they resolve tooktotalBalanceChfin financial log — should drop by ~100k CHF