mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-25 00:44:22 +01:00
pretty-print channels
This commit is contained in:
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -65,6 +66,20 @@ public class LegacyController {
|
||||
.collect(Collectors.joining(NEWLINE));
|
||||
}
|
||||
|
||||
@GetMapping("/open-channels/pretty")
|
||||
public String getOpenChannelIdsPretty() {
|
||||
return channelService.getOpenChannels().stream()
|
||||
.sorted(Comparator.comparing(LocalChannel::getId))
|
||||
.map(localChannel -> {
|
||||
Pubkey pubkey = localChannel.getRemotePubkey();
|
||||
return localChannel.getId().getCompactForm() +
|
||||
"\t" + pubkey +
|
||||
"\t" + localChannel.getCapacity() +
|
||||
"\t" + nodeService.getAlias(pubkey);
|
||||
})
|
||||
.collect(Collectors.joining(NEWLINE));
|
||||
}
|
||||
|
||||
@GetMapping("/peer-pubkeys")
|
||||
public String getPeerPubkeys() {
|
||||
return channelService.getOpenChannels().stream()
|
||||
|
||||
Reference in New Issue
Block a user