Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(wallet): corretly sort channels by activity
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Apr 12, 2020
1 parent ee864c5 commit 7c35b2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion renderer/reducers/channels/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ export const decorateChannel = (channelObj, nodes, closingChannelIds, loadingCha
const flow = CoinBig.sum(sent, received)

// Calculate capacity as flow / capacity.
return flow
const activity = flow
.dividedBy(CoinBig(capacity))
.multipliedBy(100)
.toFixed(0)

return Number(activity)
}

return 0
Expand All @@ -152,5 +154,6 @@ export const decorateChannel = (channelObj, nodes, closingChannelIds, loadingCha
channel: updatedChannelData,
}
}

return updatedChannelData
}

0 comments on commit 7c35b2a

Please sign in to comment.