Skip to content

Commit

Permalink
Merge pull request #182 from Ride-The-Lightning/lrbalance-precision
Browse files Browse the repository at this point in the history
Lrbalance precision
  • Loading branch information
ShahanaFarooqui authored Jun 19, 2023
2 parents 78909a9 + 6e1e741 commit 4276539
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/localRemoteBal.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ exports.localRemoteBal = (req,res) => {
{
if((chanArray[i].state === 'CHANNELD_NORMAL') && chanArray[i].connected === true) {
localBalance = localBalance + (versionCompatible ? (chanArray[i].our_amount_msat) : chanArray[i].channel_sat);
remoteBalance = remoteBalance + (versionCompatible ? (chanArray[i].amount_msat) : (chanArray[i].channel_total_sat - 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) : chanArray[i].channel_sat);
}
else if(chanArray[i].state === 'CHANNELD_AWAITING_LOCKIN') {
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);
}
}
Expand Down

0 comments on commit 4276539

Please sign in to comment.