L2-Technology / sensei

A lightning node implementation for everyone
https://l2.technology/sensei
Other
199 stars 39 forks source link

feat: add support for custom expiry #93

Open louneskmt opened 2 years ago

louneskmt commented 2 years ago

A quick PR adding support for custom invoice expiry delta in seconds. By default, it was set to 3600 (one hour). It is now possible to add an optional parameter to change this value.

The API and internal functions are the only scopes of this PR, a follow-up PR would be needed to add CLI and Web support.

@johncantrell97 Do I need to add an expiry column to the Payment Model?

johncantrell97 commented 2 years ago

Hm, I guess we could add it explicitly to the payments table. Technically it's encoded in the invoice which is already included in the table, right? I guess some of the other fields are probably also already encoded in the invoice and added seperately as well.

Let's add it. Don't bother with a new migration though, just add it to the create_payments_table one and then you'll need to pass it through when we create an invoice.