This commit is contained in:
Carsten Otto
2021-11-29 17:18:24 +01:00
parent 2760238756
commit 5756ee33b6

View File

@@ -76,7 +76,7 @@ public class GrpcService extends GrpcBase {
stubCreator.shutdown();
}
Optional<GetInfoResponse> getInfo() {
public Optional<GetInfoResponse> getInfo() {
return get("getInfo", () -> lightningStub.getInfo(lnrpc.GetInfoRequest.getDefaultInstance()));
}
@@ -84,12 +84,6 @@ public class GrpcService extends GrpcBase {
return listPeersCache.get("");
}
private List<Peer> listPeersWithoutCache() {
return get(
"listPeers", () -> lightningStub.listPeers(ListPeersRequest.getDefaultInstance()).getPeersList()
).orElse(List.of());
}
public Optional<NodeInfo> getNodeInfo(Pubkey pubkey) {
return get("getNodeInfo", () -> {
try {
@@ -113,10 +107,6 @@ public class GrpcService extends GrpcBase {
return channelsCache.get("");
}
private Optional<PendingChannelsResponse> getPendingChannels() {
return pendingChannelsCache.get("");
}
public List<ChannelCloseSummary> getClosedChannels() {
return get("closedChannels",
() -> lightningStub.closedChannels(ClosedChannelsRequest.getDefaultInstance()).getChannelsList()
@@ -139,6 +129,16 @@ public class GrpcService extends GrpcBase {
return getTransactionsCache.get("");
}
private List<Peer> listPeersWithoutCache() {
return get(
"listPeers", () -> lightningStub.listPeers(ListPeersRequest.getDefaultInstance()).getPeersList()
).orElse(List.of());
}
private Optional<PendingChannelsResponse> getPendingChannels() {
return pendingChannelsCache.get("");
}
private Optional<List<Transaction>> getTransactionsWithoutCache() {
return get("getTransactions",
() -> lightningStub.getTransactions(GetTransactionsRequest.getDefaultInstance()).getTransactionsList()