mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
Merge pull request #5768 from priyanshiiit/lookupInvoice
lnd: adds NOT_FOUND status code for LookupInvoice
This commit is contained in:
commit
884cc0d191
@ -105,6 +105,8 @@ proposed channel type is used.
|
|||||||
allows external tools to hook into `lnd`'s RPC server and intercept any
|
allows external tools to hook into `lnd`'s RPC server and intercept any
|
||||||
requests made with custom macaroons (and also the responses to those
|
requests made with custom macaroons (and also the responses to those
|
||||||
requests).
|
requests).
|
||||||
|
|
||||||
|
* [Adds NOT_FOUND status code for LookupInvoice](https://github.com/lightningnetwork/lnd/pull/5768)
|
||||||
|
|
||||||
### Batched channel funding
|
### Batched channel funding
|
||||||
|
|
||||||
@ -393,6 +395,7 @@ change](https://github.com/lightningnetwork/lnd/pull/5613).
|
|||||||
* Martin Habovstiak
|
* Martin Habovstiak
|
||||||
* Naveen Srinivasan
|
* Naveen Srinivasan
|
||||||
* Oliver Gugger
|
* Oliver Gugger
|
||||||
|
* Priyansh Rastogi
|
||||||
* Wilmer Paulino
|
* Wilmer Paulino
|
||||||
* xanoni
|
* xanoni
|
||||||
* Yong Yu
|
* Yong Yu
|
||||||
|
@ -5101,7 +5101,10 @@ func (r *rpcServer) LookupInvoice(ctx context.Context,
|
|||||||
rpcsLog.Tracef("[lookupinvoice] searching for invoice %x", payHash[:])
|
rpcsLog.Tracef("[lookupinvoice] searching for invoice %x", payHash[:])
|
||||||
|
|
||||||
invoice, err := r.server.invoices.LookupInvoice(payHash)
|
invoice, err := r.server.invoices.LookupInvoice(payHash)
|
||||||
if err != nil {
|
switch {
|
||||||
|
case err == channeldb.ErrInvoiceNotFound:
|
||||||
|
return nil, status.Error(codes.NotFound, err.Error())
|
||||||
|
case err != nil:
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user