forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switchrpc: protect from attemptID reuse
Add a memory optimized store for SendOnion/TrackOnion duplication/safe ordering protection. This ensures that if TrackOnion returns PAYMENT_ID_NOT_FOUND or SendOnion initiates HTLC creation for a given attempt ID, SendOnion cannot subsequently succeed with the same attempt ID. This mechanism safeguards against overpayment in scenarios where network requests are reordered. If an attempt ID has already been used by either SendOnion or TrackOnion, SendOnion will return DUPLICATE_HTLC for that attempt ID. Used https://github.com/RoaringBitmap/roaring as a store for attemp IDs.
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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