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'])
        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,
  • 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
    Apr 29, 2019 at 10:22

2 Answers 2


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.

  • 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
    Apr 29, 2019 at 13:09
  • 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
    Apr 29, 2019 at 13:17

as Rene Pickhardt 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

  • 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 Apr 29, 2019 at 6:42
  • 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
    Apr 29, 2019 at 8:15
  • Yeah but as Cdecker wrote you make a different api call in your python script in comparison to the cli call Apr 29, 2019 at 12:05
  • 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
    Apr 29, 2019 at 12:26
  • My question title is misleading, it should be: why listfunds() and getinfo() shows me different stats. Regardless of api/cli
    – baysx
    Apr 29, 2019 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.