Skip to content

Commit fb9eb2a

Browse files
committed
Fix volume summation
1 parent 4d2b599 commit fb9eb2a

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

apps/frontend/src/components/bookkeeper/Volume/VolumeRoot.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const VolumeRoot = (props) => {
2121
const fetchVolumeData = useCallback(async () => {
2222
getVolumeData()
2323
.then((response: VolumeData) => {
24+
console.log("123 volume = " + JSON.stringify(response));
2425
setVolumeData(response);
2526
})
2627
.catch(err => {

apps/frontend/src/sql/bookkeeper-sql.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ export const SatsFlowSQL = (startTimestamp: number, endTimestamp: number): strin
2929
"SELECT in_channel, " +
3030
"(SELECT peer_id FROM peerchannels WHERE peerchannels.short_channel_id=in_channel) AS in_channel_peerid, " +
3131
"(SELECT nodes.alias FROM nodes WHERE nodes.nodeid=(SELECT peer_id FROM peerchannels WHERE peerchannels.short_channel_id=in_channel)) AS in_channel_peer_alias, " +
32-
"in_msat, " +
32+
"SUM(in_msat), " +
3333
"out_channel, " +
3434
"(SELECT peer_id FROM peerchannels WHERE peerchannels.short_channel_id=out_channel) AS out_channel_peerid, " +
3535
"(SELECT nodes.alias FROM nodes WHERE nodes.nodeid=(SELECT peer_id FROM peerchannels WHERE peerchannels.short_channel_id=out_channel)) AS out_channel_peer_alias, " +
36-
"out_msat, " +
37-
"fee_msat " +
36+
"SUM(out_msat), " +
37+
"SUM(fee_msat) " +
3838
"FROM forwards " +
3939
"WHERE forwards.status='settled' " +
4040
"GROUP BY in_channel, out_channel;";

apps/frontend/src/sql/bookkeeper-transform.ts

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ export function transformToSatsFlow(
315315
}
316316

317317
export function transformToVolumeData(rawSqlResultSet: RawVolumeResultSet): VolumeData {
318+
console.log("123 raw = " + JSON.stringify(rawSqlResultSet));
318319
let returnForwards: Forward[] = [];
319320
let totalOutboundSat = 0;
320321
let totalFeeSat = 0;

0 commit comments

Comments
 (0)