How to know earning LN routing fees

1

I am using c-lightning version:v0.6-182-g1851ebb. Is there a way to know how much I have earned routing fees? I found that lnd has lncli feereport command that shows earned fees. Does c-lightning have same functionality? If not, is there a way to know earned routing fees?

I created a query for calculating earned routing fees. However, this doesn't work because HTLCs info is removed when a channel forwarded HTLCs closed.

sqlite3 $HOME/.lightning/lightningd.sqlite3 "select sum(a.msatoshi - b.msatoshi) from channel_htlcs a inner join channel_htlcs b on a.id = b.origin_htlc"

Any ideas?

Yuya Ogawa

Posted 2018-07-18T02:54:11.787

Reputation: 471

Answers

1

lightning-cli listforwards

List all forwarded payments and their information

fiatjaf

Posted 2018-07-18T02:54:11.787

Reputation: 223

0

I've written a plug-in for c-lightning that emulates lncli feereport command of LND. For full functionality, including day_fee_sum, week_fee_sum and month_fee_sum calculations, requires c-lightning v0.7.1 or newer (older versions didn't save timestamps for historical forwards).

https://github.com/kristapsk/lightning-feereport

Kristaps Kaupe

Posted 2018-07-18T02:54:11.787

Reputation: 121