Conversation
Closes lightningdevkit#1084 Previously close_channel and force_close_channel returned Ok(()) when no matching UserChannelId was found for the counterparty, silently succeeding without initiating a close. Now returns Err(ChannelClosingFailed), matching update_channel_config. AI-assisted: generated by Sera (Hermes Agent), verified manually. Tests compile; integration test requires bitcoind/electrs binaries (architecturally incompatible electrs binary in this cron environment, same failure affects all integration tests) Signed-off-by: Bartok9 <259807879+Bartok9@users.noreply.github.com>
…istenceFailed errors The BOLT12 arm of UnifiedPayment::send was using a .map_err() + if let Ok pattern that caused Critical errors (DuplicatePayment, PersistenceFailed) to fall through to the BOLT11/onchain payment methods. This could result in double-payment if: 1. A BOLT12 payment fails with PersistenceFailed (e.g., payment store insert fails after ChannelManager accepted the payment) 2. The code falls through to BOLT11 attempt 3. BOLT11 also fails with PersistenceFailed 4. The code falls through to on-chain broadcast 5. User is charged twice (once via Lightning, once via on-chain) This fix mirrors the BOLT11 arm fix in PR lightningdevkit#1038. Both DuplicatePayment and PersistenceFailed are now terminal errors that abort the unified payment entirely. Fixes: lightningdevkit#1060
|
I've assigned @tnull as a reviewer! |
Collaborator
|
The two issues addressed are not even related. Please don't just mix arbitrary issues in one PR. |
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.
fix(close_channel): error when no matching channel found
Closes close_channel returns Ok when no channel matches the user_channel_id #1084
Previously close_channel and force_close_channel returned Ok(()) when
no matching UserChannelId was found for the counterparty, silently
succeeding without initiating a close. Now returns Err(ChannelClosingFailed),
matching update_channel_config.
AI-assisted: generated by Sera (Hermes Agent), verified manually.
Tests compile; integration test requires bitcoind/electrs binaries
(architecturally incompatible electrs binary in this cron environment,
same failure affects all integration tests)
Signed-off-by: Bartok9 259807879+Bartok9@users.noreply.github.com
fix: BOLT12 arm of UnifiedPayment::send returns DuplicatePayment/PersistenceFailed errors
The BOLT12 arm of UnifiedPayment::send was using a .map_err() + if let Ok pattern
that caused Critical errors (DuplicatePayment, PersistenceFailed) to fall through to the
BOLT11/onchain payment methods. This could result in double-payment if:
ChannelManager accepted the payment)
This fix mirrors the BOLT11 arm fix in PR Fix BOLT11 DuplicatePayment triggering on-chain fallback in unified payment #1038. Both DuplicatePayment and
PersistenceFailed are now terminal errors that abort the unified payment entirely.
Fixes: BOLT12 leg falls through to BOLT11/on-chain on already-initiated errors #1060