1
I am running a c-lightning node and want to know how many btc I am owning on this wallet and how many I can spend. lightning-cli listchannels does not help. What do I need to do?
1
I am running a c-lightning node and want to know how many btc I am owning on this wallet and how many I can spend. lightning-cli listchannels does not help. What do I need to do?
2
Use the RPC-Interface listfunds lightning-cli listfunds which lists all payment channels and UTXO.
If you wish to have a more nicely display you can use this small tool: https://github.com/renepickhardt/lightning-helpers
git clone https://github.com/renepickhardt/lightning-helpers.git
cd lightning-helpers
sudo make install
listfunds
it aggregates everything so that you can see your total funds. Also you can add a parameter to change the unit of display.
If you don't trust a third party tool and don't want to read the source code you can use this little shell script:
utxo values:
lightning-cli listfunds | grep "value" | sed 's/ "value": //g' | sed 's/,//g' | awk '{s+=$1} END {print s}'
total channel balance on your side:
lightning-cli listfunds | grep "channel_sat" | sed 's/ "channel_sat": //g' | sed 's/,//g' | awk '{s+=$1} END {print s}'