Commit graph

15 commits

Author SHA1 Message Date
carla
2a13fa459c
docs: move accounting docs to docs dir
To allign with our other projects, move our accounting docs into a base
docs dir. Since we've sent the existing link out, we leave a docs file
pointing to our new docs location so nobody gets lost.
2020-11-26 15:09:35 +02:00
carla
447fd7a7c6
accounting: allow no fee function and skip fee entries
To allow running our accounting report without a backing bitcoin node,
we allow the fee function provided to be nil. In these cases, we log
the entries which we cannot lookup fees for so that users have the
option to manually lookup those fees.
2020-09-09 10:41:38 +02:00
carla
fb9884611c
accounting: lookup fees for sweep transactions 2020-08-12 11:15:01 +02:00
carla
7d2ee52f32
accounting: add channel close fee for channels we initiated 2020-08-12 11:14:56 +02:00
carla
b110781039
accounting: update payment note to include destination node 2020-06-29 10:56:23 +02:00
carla
a9baf39b8d
accounting: fallback to payment request for payments without htlcs
We have a lot of different payment formats in lnd, since the payments
database has been migrated multiple times. We need to account for the
following:
- Legacy payments: settled, no htlcs present
- In flight payments: not settled, no htlcs present
- Keysend payments: no payment request
- Sendpayment + dest: no payment request present

Since we need to list all payments (an invoice settled in our period
could have been send by a payment before the period), we update our
code to not fail in the case where we do not know payment destination.
This will result in legacy circular payments (that were made with no
payment request) not being identified as circular payments (as well as
their corresponding invoices). We log an error for this, and make a
note of it in our docs. This should not be an issue for payments made
by newer versions on lnd, because they have the information we require.
2020-06-29 10:56:20 +02:00
carla
2812ac3470
accounting: add sweep entry type 2020-06-18 16:40:26 +02:00
carla
d9651f0796
accounting+frdrpc: add payments to off chain report
Add payments to off chain report, failing if there are any duplicate
payments in the period being queried. Legacy payments in lnd have
duplicate payments which add significant overhead to dealing with
payments. Rather than carry the tech debt, we do not support these
payments.
2020-06-05 13:01:24 +02:00
carla
a1fd2dbbd2
accounting: add regular and circular payment entries 2020-06-05 13:01:24 +02:00
carla
d74b381e2f
accounting: note that amounts are expressed in msat in docs 2020-05-29 15:13:38 +02:00
carla
6975e0353d
accounting: add forwarding entries 2020-05-29 14:59:28 +02:00
carla
daefa472be
accounting: add invoice entry with circular payment special case
Add entry generation for invoices, including the special case where we
made a payment to ourselves. This is common practise for nodes that
manage liquidity with circular rebalancing. We record this as a balance
increase because money has moved; the amount that we gain will be offset
with a circular payment entry of matching amounts when we create payment
records.
2020-05-25 12:04:30 +02:00
carla
5d78f074da
accounting: add on chain entries 2020-05-20 15:43:23 +02:00
carla
4b482309a2
accounting: add channel close entry generation
Add entries for the close transaction that spends from our funding tx.
Note that this change *does not* account for resolutions that occur
on chain after this close. Since we have to resolve our own balance on
chain for local force closes, these entries may have a zero balance.
2020-05-20 15:22:19 +02:00
carla
9c90afdcf1
accounting: add open channel entry type 2020-05-20 15:21:44 +02:00