aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-05-25 22:51:33 +0000
committerAdam Soltys <[email protected]>2023-05-25 22:51:41 +0000
commit07520c066d48bbfe32c3de640d09bd9400417992 (patch)
treeb3e7cc823fe78f9a2f2065b62d5d64ae4ff30602
parenta59d0ce5f34ce39b5d15cf7ce3e4a2f67ce6e970 (diff)
downloadcoinos-server-07520c066d48bbfe32c3de640d09bd9400417992.tar.gz
coinos-server-07520c066d48bbfe32c3de640d09bd9400417992.zip
cln api change
-rwxr-xr-xwatcher.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/watcher.sh b/watcher.sh
index 405aecfb..eca31ebb 100755
--- a/watcher.sh
+++ b/watcher.sh
@@ -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')