channeldb: return error when payment is not initialized
This commit changes `fetchPaymentStatus` to return an error when the payment creation info bucket cannot be found. Instead of using the ambiguous status `StatusUnknown`, we tell the callsite explictly that there's no such payment. This also means the vague `StatusUnknown` can now be removed as it has multiple meanings.
This commit is contained in:
1 parent
21cecc40e1
commit
6be3817eed
4 files changed
+40
-54
No files matched your search
@@ -1370,9 +1370,6 @@ func convertPaymentStatus(dbStatus channeldb.PaymentStatus) (
|
||||
lnrpc.Payment_PaymentStatus, error) {
|
||||
|
||||
switch dbStatus {
|
||||
case channeldb.StatusUnknown:
|
||||
return lnrpc.Payment_UNKNOWN, nil
|
||||
|
||||
case channeldb.StatusInFlight:
|
||||
return lnrpc.Payment_IN_FLIGHT, nil
|
||||
|
||||
|
||||
Reference in new issue
Block a user