mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-30 19:24:29 +01:00
refactor
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user