Skip to content

Improve payinvoice API response#2525

Merged
t-bast merged 1 commit into
masterfrom
improve-pay-invoice-result
Dec 21, 2022
Merged

Improve payinvoice API response#2525
t-bast merged 1 commit into
masterfrom
improve-pay-invoice-result

Conversation

@t-bast
Copy link
Copy Markdown
Member

@t-bast t-bast commented Dec 9, 2022

When sending an outgoing multi-part payment, we forward the preimage back to the sender as soon as we receive the first update_fulfill_htlc. This is particularly useful when relaying trampoline payments, to be able to propagate the fulfill upstream as early as possible.

However this meant that callers of the HTTP API would receive this preimage event instead of the final payment result, which was quite bad. We now disable this first event when used with the --blocking argument, which ensures that the API always returns the payment result.

Fixes #2389

@t-bast t-bast force-pushed the improve-pay-invoice-result branch from e33ce81 to 1f26363 Compare December 9, 2022 14:04
When sending an outgoing multi-part payment, we forward the preimage back
to the sender as soon as we receive the first `update_fulfill_htlc`.
This is particularly useful when relaying trampoline payments, to be able
to propagate the fulfill upstream as early as possible.

However this meant that callers of the HTTP API would receive this
preimage event instead of the final payment result, which was quite bad.
We now disable this first event when used with the `--blocking` argument,
which ensures that the API always returns the payment result.

Fixes #2389
@t-bast t-bast force-pushed the improve-pay-invoice-result branch from 1f26363 to f51b867 Compare December 20, 2022 10:56
@t-bast t-bast requested review from pm47 and thomash-acinq December 20, 2022 10:57
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #2525 (f51b867) into master (b5a2d3a) will increase coverage by 0.01%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##           master    #2525      +/-   ##
==========================================
+ Coverage   85.17%   85.18%   +0.01%     
==========================================
  Files         202      202              
  Lines       15996    15994       -2     
  Branches      689      664      -25     
==========================================
  Hits        13624    13624              
+ Misses       2372     2370       -2     
Impacted Files Coverage Δ
...r-core/src/main/scala/fr/acinq/eclair/Eclair.scala 52.08% <0.00%> (+0.53%) ⬆️
...cala/fr/acinq/eclair/payment/relay/NodeRelay.scala 96.57% <100.00%> (-0.69%) ⬇️
...clair/payment/send/MultiPartPaymentLifecycle.scala 94.11% <100.00%> (+0.03%) ⬆️
...r/acinq/eclair/payment/send/PaymentInitiator.scala 88.00% <100.00%> (-0.10%) ⬇️
...main/scala/fr/acinq/eclair/router/Validation.scala 93.53% <0.00%> (-1.24%) ⬇️
...in/scala/fr/acinq/eclair/channel/fsm/Channel.scala 86.11% <0.00%> (+0.11%) ⬆️
...fr/acinq/eclair/channel/InteractiveTxBuilder.scala 85.07% <0.00%> (+0.52%) ⬆️
...cala/fr/acinq/eclair/crypto/TransportHandler.scala 91.16% <0.00%> (+0.55%) ⬆️
...scala/fr/acinq/eclair/router/BalanceEstimate.scala 100.00% <0.00%> (+1.08%) ⬆️

@t-bast t-bast merged commit 5b19e58 into master Dec 21, 2022
@t-bast t-bast deleted the improve-pay-invoice-result branch December 21, 2022 08:16
t-bast added a commit that referenced this pull request Jun 16, 2023
This release introduces a few API changes:

- `audit` now accepts `--count` and `--skip` parameters to limit the
  number of retrieved items (#2474, #2487)
- `sendtoroute` removes the `--trampolineNodes` argument and
  implicitly uses a single trampoline hop (#2480)
- `sendtoroute` now accept `--maxFeeMsat` to specify an upper bound
  of fees (#2626)
- `payinvoice` always returns the payment result when used with
  `--blocking`, even when using MPP (#2525)
- `node` returns high-level information about a remote node (#2568)
- `channel-created` is a new websocket event that is published when
  a channel's funding transaction has been broadcast (#2567)
- `channel-opened` websocket event was updated to contain the final
  `channel_id` and be published when a channel is ready to process
  payments (#2567)
- `getsentinfo` can now be used with `--offer` to list payments sent
  to a specific offer
- `listreceivedpayments` lists payments received by your node (#2607)
- `closedchannels` lists closed channels. It accepts `--count` and
  `--skip` parameters to limit the number of retrieved items as well
  (#2642)
- `cpfpbumpfees` can be used to unblock chains of unconfirmed
  transactions by creating a child transaction that pays a high fee
  (#1783)
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.

API feature request: return feesPaid in payinvoice

3 participants