<p>It would appear that you have (or rather had them at the time you ran the commands) 6 channels that were funded, but not yet announced. This is most likely why your node sees them (<code>getinfo</code>) but <code>gossipd</code> doesn't yet (<code>listchannels</code>) since they haven't been announced just yet. </p>

CC BY-SA 4.0
2019-04-29T13:09:13.910Z
Nvm previous comment its misleading and has nothing to do with question. But should i use listchannels() to get more descriptive info about inactive channels mentioned in getinfo()?
baysx
CC BY-SA 4.0
2019-04-29T13:17:59.170Z
They are two separate sources of information, so we'd need to reconcile the differences. Might be worth doing at some point, but likely a low priority task currently.
cdecker
CC BY-SA 4.0
2019-04-28T21:44:16.177Z
2019-04-28T21:44:16.177Z
cdecker
<p>as Rene Pickhardt pointed me:</p>

<blockquote>
  <p>without context I studiert you installed the pylifhtning client via
  pip and upgraded you lightning node later so that the APIs have
  different versions. But that is only a wild guess for a common error</p>
</blockquote>

CC BY-SA 4.0
2019-04-29T06:42:27.757Z
To my defense when I was approached with the question I only knew that the output differed. I did not know how and pointed also out that my replay was a rough / blind guess
Rene Pickhardt
CC BY-SA 4.0
2019-04-29T08:15:21.133Z
anyway, this was a good point. i really had different versions of api and cli and your suggestion makes sense to prevent futher glitches!
baysx
CC BY-SA 4.0
2019-04-29T12:05:06.103Z
Yeah but as Cdecker wrote you make a different api call in your python script in comparison to the cli call
Rene Pickhardt
CC BY-SA 4.0
2019-04-29T12:26:42.193Z
Emmm.. i didnt get it first, i understood thad different software subprocesses are acting in different ways, but soon or late ill get same result. In general i would like exactly to compare the data which gives listfunds and getinfo. I used api simply to not count inactive channels manually, but the idea was to found detailed information about inactive channels that getinfo() outputs. I thought listchannels() is exactly what i need for this
baysx
CC BY-SA 4.0
2019-04-29T12:49:05.603Z
My question title is misleading, it should be: why listfunds() and getinfo() shows me different stats. Regardless of api/cli
baysx
CC BY-SA 4.0
2019-04-28T21:01:49.963Z
2019-04-28T21:01:49.963Z
baysx
<p>I have strange results comparing node information outputs between getinfo() and listchannels() calls. Maybe someone has thoughts what is wrong (with my trivial code or with c-lightning itself):</p>

<pre><code>chans = lnd.listchannels(source=mychan)['channels']
for chan in chans:
    if chan['active'] == False:
        total_inactive += 1
        print('inactive chan with node: ' + chan['destination'])
    else:
        total_active += 1

print('my inactive chans: ' + str(total_inactive))
print('my active chans: ' + str(total_active))
</code></pre>

<p>gives me:</p>

<pre><code>my inactive chans: 2 
my active chans: 23
</code></pre>

<p>But, lightning-cli getinfo gives:</p>

<pre><code>"num_active_channels": 25,
"num_inactive_channels": 5,
</code></pre>

CC BY-SA 4.0
2019-04-29T10:22:32.153Z
waited for 10+ hours.. now things become even more strange. while upgrading the node there was an event when i launched backuped node copy, so many of my channels closed for some reason (perhaps channels closed because other nodes refused old data). anyway, tried again to launch script and getinfo:

getinfo:
"num_active_channels" : 5,
"num_inactive_channels" : 25

while script output:
my inactive chans: 3
my active chans: 2

wierd.. but i think this is due to slow state refreshing in LN. will close manually 'inactive' channels i see on cli and then ill reply about results
baysx
<python><core-lightning>
Why getinfo() and listchannels() inactive channel count differs?
baysx
# Why getinfo() and listchannels() inactive channel count differs?

(Asked by: username_0 on 2019-04-28)

I have strange results comparing node information outputs between getinfo() and listchannels() calls. Maybe someone has thoughts what is wrong (with my trivial code or with c-lightning itself):
chans = lnd.listchannels(source=mychan)['channels']
for chan in chans:
    if chan['active'] == False:
        total_inactive += 1
        print('inactive chan with node: ' + chan['destination'])
    else:
        total_active += 1

print('my inactive chans: ' + str(total_inactive))
print('my active chans: ' + str(total_active))

gives me:
my inactive chans: 2 
my active chans: 23

But, lightning-cli getinfo gives:
"num_active_channels": 25,
"num_inactive_channels": 5,

**Tags:** python, core-lightning

> **Comments:**
> **username_0**: waited for 10+ hours.. now things become even more strange. while upgrading the node there was an event when i launched backuped node copy, so many of my channels closed for some reason (perhaps channels closed because other nodes refused old data). anyway, tried again to launch script and getinfo:  getinfo: "num_active_channels" : 5, "num_inactive_channels" : 25  while script output: my inactive chans: 3 my active chans: 2  wierd.. but i think this is due to slow state refreshing in LN. will close manually 'inactive' channels i see on cli and then ill reply about results  

---

## 2 answers

### Answer by username_1 on 2019-04-28. Score: 1 | Accepted answer

It would appear that you have (or rather had them at the time you ran the commands) 6 channels that were funded, but not yet announced. This is most likely why your node sees them (`getinfo`) but `gossipd` doesn't yet (`listchannels`) since they haven't been announced just yet.

> **Comments:**
> **username_0**: Nvm previous comment its misleading and has nothing to do with question. But should i use listchannels() to get more descriptive info about inactive channels mentioned in getinfo()?  
> **username_1**: They are two separate sources of information, so we'd need to reconcile the differences. Might be worth doing at some point, but likely a low priority task currently.  

---

### Answer by username_0 on 2019-04-28. Score: 0

as username_2 pointed me:

> without context I studiert you installed the pylifhtning client via
> pip and upgraded you lightning node later so that the APIs have
> different versions. But that is only a wild guess for a common error

> **Comments:**
> **username_2**: To my defense when I was approached with the question I only knew that the output differed. I did not know how and pointed also out that my replay was a rough / blind guess  
> **username_0**: anyway, this was a good point. i really had different versions of api and cli and your suggestion makes sense to prevent futher glitches!  
> **username_2**: Yeah but as Cdecker wrote you make a different api call in your python script in comparison to the cli call  
> **username_0**: Emmm.. i didnt get it first, i understood thad different software subprocesses are acting in different ways, but soon or late ill get same result. In general i would like exactly to compare the data which gives listfunds and getinfo. I used api simply to not count inactive channels manually, but the idea was to found detailed information about inactive channels that getinfo() outputs. I thought listchannels() is exactly what i need for this  
> **username_0**: My question title is misleading, it should be: why listfunds() and getinfo() shows me different stats. Regardless of api/cli  

---

