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

Eclair accepts payments after payment request timeout period. #748

Closed
n1bor opened this issue Oct 26, 2018 · 2 comments
Closed

Eclair accepts payments after payment request timeout period. #748

n1bor opened this issue Oct 26, 2018 · 2 comments

Comments

@n1bor
Copy link
Contributor

n1bor commented Oct 26, 2018

Describe the issue
I create a payment request and specify a timeout of 1 second.
I check the payment request and it correctly contains the 1 second timeout.
I wait 10 seconds.
I pay the payment request from another node.

What behaviour did you expect?
The payment should be rejected.
BOLT#11
A payee SHOULD NOT accept a payment after timestamp plus expiry.
https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md#payer--payee-requirements

What was the actual behaviour (provide screenshots if the issue is GUI-related)?
The payment is accepted.

How reliably can you reproduce the issue, what are the steps to do so?
100% - steps are above.

What version of Eclair are you using, where did you get it (website, self-compiled, etc)?
HEAD as of 26th Oct 2018

What environment are you observing the error on (OS, JDK version)?
Linux/1.8

Any extra information that might be useful in the debugging process.
This match in LocalPaymentHandler has no logic to check the timeout.
In addition to the check on paymentRequest.amount here:


We need a check on paymentRequest.expirySeconds in here:
log.info(s"received payment for paymentHash=${htlc.paymentHash} amountMsat=${htlc.amountMsat}")

@sstone
Copy link
Member

sstone commented Oct 31, 2018

Yes, this true but only for payment requests with a timeout that is less than 10 minutes which is still very uncommon (because we check and purge payment requests every 10 minutes).

@n1bor
Copy link
Contributor Author

n1bor commented Oct 31, 2018

Issue is when you have some deadline for a payment - say a competition etc... then if you get a payment after the deadline you have to return the funds. Which with lighting is more trick than bitcoin as you have no return address by default.
Also currently there is no test for the expiry field. At least with this patch that is now covered!

n1bor added a commit to n1bor/eclair that referenced this issue Nov 8, 2018
Expiry Tag time has been exceeded.
Fixes ACINQ#748
@pm47 pm47 closed this as completed in #749 Nov 15, 2018
pm47 pushed a commit that referenced this issue Nov 15, 2018
…n exceeded. (#749)

This fixes #748.

Also renamed htlc `expiry` to `cltvExpiry`. This removes confusion between different types of expiries and is how the spec is written.
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

No branches or pull requests

2 participants