Commit Graph

14 Commits

Author SHA1 Message Date
Michael Bumann
f6367b33a0 Merge pull request #69 from getAlby/bugfix/fix-invoices-without-description
Do not fail if invoice does not have a description
2022-01-24 20:12:29 +02:00
Michael Bumann
edd2abedfb Do not fail if invoice does not have a description 2022-01-22 23:05:21 +01:00
Michael Bumann
af8c72d2c9 Store invoice expiry and use search for not expired invoices in the invoice subscription
When subscribing for invoice updates we only subscribe to not expired invoices.
We assume expired invoices will never get paid.
2022-01-22 21:11:19 +01:00
Michael Bumann
43aba70dd8 Fix invoice preimages for internal payments
We create the preimage on incoming invoices. If it is an internal incoming payment (meaning from one user to another user) we use that preimage and save it on the outgoing invoice.
This makes sure we can give wallets the correct preimage for a payment request even though no lightning transaction happened
2022-01-21 13:56:02 +01:00
Michael Bumann
55fbaeea92 nullzero entry for the parent txn 2022-01-21 11:17:19 +01:00
Michael Bumann
7d955a1d7b Support self-payments
If the destination of the invoice is our node we only create internal transaction entries and do not call the underlaying lightning node
2022-01-20 16:50:26 +01:00
Michael Bumann
90a686677f Save invoice destination
And save the node pubkey in the service to make it usable
2022-01-20 15:41:50 +01:00
Michael Bumann
d4183c100b Add payinvoice endpoint 2022-01-20 01:57:31 +01:00
Michael Bumann
f625ef7efc Implement addinvoice call 2022-01-19 19:43:29 +01:00
kiwiidb
ecd4894673 refactor balance 2022-01-19 14:18:34 +01:00
Michael Bumann
a07aa749f0 Move balance calculationo to User model 2022-01-19 13:16:25 +01:00
Michael Bumann
b38357091d Add DB view for easier balance calculation and extend model associations 2022-01-19 10:57:50 +01:00
Roman Useinov
e7e5904829 UserMiddleware added 2022-01-16 14:02:58 +00:00
Roman Useinov
628071160c Cleanup (#25)
* remove cmd folder as we are going to have only one entrypoint

* get rid of pkg directory

* rename test -> integration_tests as unit tests should reside next to the actual files they are testing

* database migration WIP

* reinstate gorm boilerplate in the addinvoice for now to make it compile

* introduce migrations

* add Makefile

* don't use unsigned types for database mappings

* migrations work now

* add build target

* use echo groups

* gorm removed

* add envconfig

* fix comments
2022-01-16 00:49:19 +01:00