user57658: 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?

user1026: 
lightning-cli listforwards
List all forwarded payments and their information


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

<p>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.</p>

<pre><code>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"
</code></pre>

<p>Any ideas?</p>
 1026: <blockquote>
  <p><code>lightning-cli listforwards</code></p>
  
  <p>List all forwarded payments and their information</p>
</blockquote>
