rpcserver: expose store final htlc resolutions flag on info call

The storage of final htlc resolutions is a safety-critical feature. By
exposing it through the GetInfo call, connected applications can
ensure that the feature is turned on and avoid relying on the assumption
that lnd was configured correctly.
This commit is contained in:
Joost Jager committed 2023-02-13 11:53:27 +01:00
1 parent db5dc4d360
commit 784c0631f3
5 files changed
+2137 -2114

No files matched your search

+20 -19
View File
@@ -2893,25 +2893,26 @@ func (r *rpcServer) GetInfo(_ context.Context,
version := build.Version() + " commit=" + build.Commit
return &lnrpc.GetInfoResponse{
IdentityPubkey: encodedIDPub,
NumPendingChannels: nPendingChannels,
NumActiveChannels: activeChannels,
NumInactiveChannels: inactiveChannels,
NumPeers: uint32(len(serverPeers)),
BlockHeight: uint32(bestHeight),
BlockHash: bestHash.String(),
SyncedToChain: isSynced,
Testnet: isTestNet,
Chains: activeChains,
Uris: uris,
Alias: nodeAnn.Alias.String(),
Color: nodeColor,
BestHeaderTimestamp: bestHeaderTimestamp,
Version: version,
CommitHash: build.CommitHash,
SyncedToGraph: isGraphSynced,
Features: features,
RequireHtlcInterceptor: r.cfg.RequireInterceptor,
IdentityPubkey: encodedIDPub,
NumPendingChannels: nPendingChannels,
NumActiveChannels: activeChannels,
NumInactiveChannels: inactiveChannels,
NumPeers: uint32(len(serverPeers)),
BlockHeight: uint32(bestHeight),
BlockHash: bestHash.String(),
SyncedToChain: isSynced,
Testnet: isTestNet,
Chains: activeChains,
Uris: uris,
Alias: nodeAnn.Alias.String(),
Color: nodeColor,
BestHeaderTimestamp: bestHeaderTimestamp,
Version: version,
CommitHash: build.CommitHash,
SyncedToGraph: isGraphSynced,
Features: features,
RequireHtlcInterceptor: r.cfg.RequireInterceptor,
StoreFinalHtlcResolutions: r.cfg.StoreFinalHtlcResolutions,
}, nil
}