mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-14 02:15:29 +02:00
lnd: don't allow lookup when StoreFinalHtlcResolutions
is false
This commit is contained in:
@@ -3942,6 +3942,11 @@ func (r *rpcServer) ClosedChannels(ctx context.Context,
|
|||||||
func (r *rpcServer) LookupHtlc(ctx context.Context,
|
func (r *rpcServer) LookupHtlc(ctx context.Context,
|
||||||
in *lnrpc.LookupHtlcRequest) (*lnrpc.LookupHtlcResponse, error) {
|
in *lnrpc.LookupHtlcRequest) (*lnrpc.LookupHtlcResponse, error) {
|
||||||
|
|
||||||
|
if !r.cfg.StoreFinalHtlcResolutions {
|
||||||
|
return nil, status.Error(codes.Unavailable, "cannot lookup "+
|
||||||
|
"with flag --store-final-htlc-resolutions=false")
|
||||||
|
}
|
||||||
|
|
||||||
chanID := lnwire.NewShortChanIDFromInt(in.ChanId)
|
chanID := lnwire.NewShortChanIDFromInt(in.ChanId)
|
||||||
|
|
||||||
info, err := r.server.chanStateDB.LookupFinalHtlc(chanID, in.HtlcIndex)
|
info, err := r.server.chanStateDB.LookupFinalHtlc(chanID, in.HtlcIndex)
|
||||||
|
Reference in New Issue
Block a user