Fix payment hash collision in outbound BTC payments - #38
Open
txalkan wants to merge 1 commit into
Open
Conversation
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.
Restrict RGB payment detection to outbound payments.
The helper was renamed from
is_payment_rgbtois_payment_rgb_outand now checks only the.outboundRGB metadata file.The helper is used exclusively by outbound routing code:
send_payment_for_bolt12_invoicesend_payment_for_non_bolt12_invoicefind_route_and_send_paymentNo inbound payment handler calls this helper. Previously, the helper checked both
.outboundand.inbound. If an inbound RGB payment and an outbound BTC payment reused the same payment hash, the outbound BTC payment could be incorrectly classified as RGB. This caused RGB-specific routing logic to run without outbound RGB metadata, leading to a panic.The existing regression test
use_same_hodl_invoice_hash_for_inbound_rgb_and_outbound_btc, included in RGB-Tools/rgb-lightning-node#91, verifies that an inbound RGB HODL payment and an outbound BTC HODL payment can successfully use the same payment hash.