Skip to content

Conversation

@wqxoxo
Copy link

@wqxoxo wqxoxo commented Nov 14, 2025

Fixes #6978 - Implements @rustyrussell's recommended fix to reset invstring_used flag on sendonion failure.

@rustyrussell
Copy link
Contributor

Hmm, maybe we should do this differently? Only set the flag to true when sendonion succeeds? Sure, that means we will have redundant strings, but it will always be set?

@wqxoxo wqxoxo force-pushed the fix/issue-6978-bolt11-sendonion branch from 40eaa38 to 5768ebd Compare November 17, 2025 18:04
@wqxoxo
Copy link
Author

wqxoxo commented Nov 17, 2025

moved the flag setting to payment_sendonion_success. The flag now only gets set after sendonion succeeds, so bolt11 will be sent with each attempt until the first successful one.

Fixes ElementsProject#6978 where bolt11 annotations were lost when sendonion failed early and payment was retried.

When sendonion RPC fails before saving payment to database, invstring_used flag would remain true, causing retry attempts to omit bolt11 parameter. Successful retries would then save to DB without bolt11 annotation.

Move invstring_used flag setting from payment_createonion_success to payment_sendonion_success. This ensures the flag is only set after sendonion actually succeeds. The bolt11 will be sent with every sendonion attempt until the first successful one, accepting the minor redundancy for cleaner state management.
@wqxoxo wqxoxo force-pushed the fix/issue-6978-bolt11-sendonion branch from 5768ebd to 46683f4 Compare November 17, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing bolt11 annotation after calling pay

2 participants