Skip to content

Commit

Permalink
Merge pull request #183 from Ride-The-Lightning/Release-v0.10.4
Browse files Browse the repository at this point in the history
Release v0.10.4
  • Loading branch information
ShahanaFarooqui committed Jun 20, 2023
2 parents 2bf3fa0 + 4276539 commit 43f7a10
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
16 changes: 11 additions & 5 deletions controllers/localRemoteBal.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,22 @@ exports.localRemoteBal = (req,res) => {
for (var i = 0; i < chanArray.length; i++ )
{
if((chanArray[i].state === 'CHANNELD_NORMAL') && chanArray[i].connected === true) {
localBalance = localBalance + (versionCompatible ? (chanArray[i].our_amount_msat/1000) : chanArray[i].channel_sat);
remoteBalance = remoteBalance + (versionCompatible ? (chanArray[i].amount_msat/1000) : (chanArray[i].channel_total_sat - chanArray[i].channel_sat));
localBalance = localBalance + (versionCompatible ? (chanArray[i].our_amount_msat) : chanArray[i].channel_sat);
remoteBalance = remoteBalance + (versionCompatible ? (chanArray[i].amount_msat - chanArray[i].our_amount_msat) : (chanArray[i].channel_total_sat - chanArray[i].channel_sat));
}
else if((chanArray[i].state === 'CHANNELD_NORMAL') && chanArray[i].connected === false) {
inactiveBalance = inactiveBalance + (versionCompatible ? (chanArray[i].our_amount_msat/1000) : chanArray[i].channel_sat);
inactiveBalance = inactiveBalance + (versionCompatible ? (chanArray[i].our_amount_msat) : chanArray[i].channel_sat);
}
else if(chanArray[i].state === 'CHANNELD_AWAITING_LOCKIN') {
pendingBalance = pendingBalance + (versionCompatible ? (chanArray[i].our_amount_msat/1000) : chanArray[i].channel_sat);
else if(chanArray[i].state === 'CHANNELD_AWAITING_LOCKIN' || chanArray[i].state === 'DUALOPEND_AWAITING_LOCKIN') {
pendingBalance = pendingBalance + (versionCompatible ? (chanArray[i].our_amount_msat) : chanArray[i].channel_sat);
}
}
if (versionCompatible) {
localBalance = localBalance / 1000;
remoteBalance = remoteBalance / 1000;
inactiveBalance = inactiveBalance / 1000;
pendingBalance = pendingBalance / 1000;
}
global.logger.log('localbalance -> ' + localBalance);
global.logger.log('remotebalance -> ' + remoteBalance);
global.logger.log('pendingBalance -> ' + pendingBalance);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c-lightning-rest",
"version": "0.10.3",
"version": "0.10.4",
"description": "c-lightning REST API suite",
"main": "cl-rest.js",
"scripts": {
Expand Down

0 comments on commit 43f7a10

Please sign in to comment.