mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 07:24:23 +01:00
add "sourced" fees to fee report
This commit is contained in:
@@ -127,7 +127,8 @@ public class ChannelController {
|
||||
|
||||
private FeeReportDto getFeeReportDto(ChannelId channelId) {
|
||||
Coins earned = feeService.getEarnedFeesForChannel(channelId);
|
||||
return new FeeReportDto(earned);
|
||||
Coins sourced = feeService.getSourcedFeesForChannel(channelId);
|
||||
return new FeeReportDto(earned, sourced);
|
||||
}
|
||||
|
||||
private PoliciesDto getPoliciesForChannel(@Nullable LocalChannel channel) {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class NodeController {
|
||||
}
|
||||
|
||||
private FeeReportDto getFeeReportDto(Pubkey pubkey) {
|
||||
return new FeeReportDto(feeService.getEarnedFeesForPeer(pubkey));
|
||||
return new FeeReportDto(feeService.getEarnedFeesForPeer(pubkey), feeService.getSourcedFeesForPeer(pubkey));
|
||||
}
|
||||
|
||||
private List<ChannelId> toSortedList(Set<? extends Channel> channels) {
|
||||
|
||||
@@ -2,8 +2,11 @@ package de.cotto.lndmanagej.controller.dto;
|
||||
|
||||
import de.cotto.lndmanagej.model.Coins;
|
||||
|
||||
public record FeeReportDto(String earned) {
|
||||
public FeeReportDto(Coins earned) {
|
||||
this(String.valueOf(earned.milliSatoshis()));
|
||||
public record FeeReportDto(String earned, String sourced) {
|
||||
public FeeReportDto(Coins earned, Coins sourced) {
|
||||
this(
|
||||
String.valueOf(earned.milliSatoshis()),
|
||||
String.valueOf(sourced.milliSatoshis())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user