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.

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, the
invstring_used flag remained true, causing retry attempts to omit
the bolt11 parameter. Successful retries would then save to DB
without bolt11 annotation.

The bug is visible in payment_createonion_success() (line 1772):
flag is set before sendonion RPC completes. If sendonion fails
immediately (e.g., no peer connection), flag remains true and
retries omit bolt11.

Fix: Reset invstring_used=false in payment_rpc_failure() when
method is "sendonion", ensuring retry attempts include bolt11.
@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?

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