diff options
| -rwxr-xr-x | watcher.sh | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -6,9 +6,9 @@ while true do f=/home/adam/coinos-server/data/funds/$(date +"%m-%d-%y-%T").json docker exec -it cl lightning-cli listfunds > $f - lnc=$(cat $f | jr '[.channels[] | select(.state == "CHANNELD_NORMAL") | .channel_sat] | add') - lnw=$(cat $f | jr '[.outputs[] | .value] | add') - ln=$(node -pe "$lnc + $lnw") + lnc=$(cat $f | jr '[.channels[] | select(.state == "CHANNELD_NORMAL") | .our_amount_msat] | add') + lnw=$(cat $f | jr '[.outputs[] | .amount_msat] | add') + ln=$(node -pe "($lnc + $lnw)/1000") bc=$(docker exec -it bc bitcoin-cli getbalance | jr) total=$(node -pe "$ln + $bc * $sats") accts=$(curl -s https://coinos.io/api/balances | jr '.total') |
