Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: optionally use a user supplied preimage when creating invoices #965

Merged
merged 18 commits into from May 17, 2019

Conversation

Projects
None yet
4 participants
@araspitzu
Copy link
Member

commented Apr 24, 2019

This enriches the /createinvoice API to accept a custom preimage and allows the caller to specify the preimage that will be used to generate the payment hash and invoice, should be used with care (low entropy on the preimage might get your incoming payment stolen). This PR builds on top of #938 .

sstone and others added some commits Apr 8, 2019

API: fix fee rate conversion
Our `open` API calls expects an optional fee rate in satoshi/byte, which is the most widely
used unit, but failed to convert to satoshi/kiloweight which is the standard in LN.
We also check that the converted fee rate cannot go below 253 satoshi/kiloweight.
Merge branch 'master' into eclair_api_test_improvements
# Conflicts:
#	eclair-core/src/test/scala/fr/acinq/eclair/EclairImplSpec.scala
Merge branch 'master' into eclair_api_test_improvements
# Conflicts:
#	eclair-core/src/main/scala/fr/acinq/eclair/Eclair.scala
Merge branch 'master' into eclair_api_test_improvements
# Conflicts:
#	eclair-core/src/main/scala/fr/acinq/eclair/Eclair.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/EclairImplSpec.scala
Merge branch 'master' into payment_request_custom_preimage
# Conflicts:
#	eclair-core/src/main/scala/fr/acinq/eclair/Eclair.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/api/Service.scala
Merge branch 'master' into payment_request_custom_preimage
# Conflicts:
#	eclair-core/src/test/scala/fr/acinq/eclair/EclairImplSpec.scala

@araspitzu araspitzu marked this pull request as ready for review May 13, 2019

@codecov-io

This comment has been minimized.

Copy link

commented May 13, 2019

Codecov Report

Merging #965 into master will increase coverage by 0.03%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master     #965      +/-   ##
==========================================
+ Coverage   80.02%   80.06%   +0.03%     
==========================================
  Files          98       98              
  Lines        7528     7528              
  Branches      298      301       +3     
==========================================
+ Hits         6024     6027       +3     
+ Misses       1504     1501       -3
Impacted Files Coverage Δ
...ala/fr/acinq/eclair/payment/PaymentLifecycle.scala 88.18% <ø> (ø) ⬆️
...e/src/main/scala/fr/acinq/eclair/api/Service.scala 68.24% <0%> (ø) ⬆️
.../fr/acinq/eclair/payment/LocalPaymentHandler.scala 100% <100%> (ø) ⬆️
...r-core/src/main/scala/fr/acinq/eclair/Eclair.scala 28.57% <100%> (+3.17%) ⬆️
...-core/src/main/scala/fr/acinq/eclair/io/Peer.scala 74.91% <0%> (-0.34%) ⬇️
...c/main/scala/fr/acinq/eclair/channel/Channel.scala 83.39% <0%> (-0.2%) ⬇️
...clair/blockchain/electrum/ElectrumClientPool.scala 78.49% <0%> (+4.3%) ⬆️
@pm47
Copy link
Member

left a comment

LGTM, just replaced preimage->paymentPreimage

Apply suggestions from code review
Rename `preimage` to `paymentPreimage`

Co-Authored-By: Pierre-Marie Padiou <pm47@users.noreply.github.com>
@araspitzu

This comment has been minimized.

Copy link
Member Author

commented May 17, 2019

TODO: update doc

@pm47

pm47 approved these changes May 17, 2019

@araspitzu araspitzu merged commit 80340c1 into master May 17, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.