mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2025-12-17 22:24:25 +01:00
add graph service and "number of known channels" endpoint
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package de.cotto.lndmanagej.service;
|
||||
|
||||
import de.cotto.lndmanagej.grpc.GrpcGraph;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Service
|
||||
public class GraphService {
|
||||
private final GrpcGraph grpcGraph;
|
||||
|
||||
public GraphService(GrpcGraph grpcGraph) {
|
||||
this.grpcGraph = grpcGraph;
|
||||
}
|
||||
|
||||
public int getNumberOfChannels() {
|
||||
return grpcGraph.getChannelEdges().map(Set::size).orElse(0);
|
||||
}
|
||||
|
||||
public void resetCache() {
|
||||
grpcGraph.resetCache();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user