lnrpc: remove deprecated payment path

Not applicable anymore on the payment level with multi-part sends.
This commit is contained in:
Joost Jager
2020-04-09 16:28:34 +02:00
parent b947ed552a
commit 06f73c0a66
5 changed files with 759 additions and 788 deletions

View File

@@ -1112,12 +1112,6 @@ func (r *RouterBackend) MarshallPayment(payment *channeldb.MPPayment) (
} }
} }
// Encode the hops from the successful route, if any.
path := make([]string, len(route.Hops))
for i, hop := range route.Hops {
path[i] = hex.EncodeToString(hop.PubKeyBytes[:])
}
msatValue := int64(payment.Info.Value) msatValue := int64(payment.Info.Value)
satValue := int64(payment.Info.Value.ToSatoshis()) satValue := int64(payment.Info.Value.ToSatoshis())
@@ -1153,7 +1147,6 @@ func (r *RouterBackend) MarshallPayment(payment *channeldb.MPPayment) (
ValueSat: satValue, ValueSat: satValue,
CreationDate: payment.Info.CreationTime.Unix(), CreationDate: payment.Info.CreationTime.Unix(),
CreationTimeNs: creationTimeNS, CreationTimeNs: creationTimeNS,
Path: path,
Fee: int64(route.TotalFees().ToSatoshis()), Fee: int64(route.TotalFees().ToSatoshis()),
FeeSat: int64(route.TotalFees().ToSatoshis()), FeeSat: int64(route.TotalFees().ToSatoshis()),
FeeMsat: int64(route.TotalFees()), FeeMsat: int64(route.TotalFees()),

File diff suppressed because it is too large Load Diff

View File

@@ -3097,8 +3097,7 @@ message Payment {
/// Deprecated, use creation_time_ns /// Deprecated, use creation_time_ns
int64 creation_date = 3 [deprecated = true]; int64 creation_date = 3 [deprecated = true];
/// The path this payment took. reserved 4;
repeated string path = 4 [deprecated = true];
/// Deprecated, use fee_sat or fee_msat. /// Deprecated, use fee_sat or fee_msat.
int64 fee = 5 [deprecated = true]; int64 fee = 5 [deprecated = true];

View File

@@ -3936,13 +3936,6 @@
"format": "int64", "format": "int64",
"title": "/ Deprecated, use creation_time_ns" "title": "/ Deprecated, use creation_time_ns"
}, },
"path": {
"type": "array",
"items": {
"type": "string"
},
"description": "/ The path this payment took."
},
"fee": { "fee": {
"type": "string", "type": "string",
"format": "int64", "format": "int64",

View File

@@ -4336,15 +4336,12 @@ func testListPayments(net *lntest.NetworkHarness, t *harnessTest) {
len(paymentsResp.Payments), 1) len(paymentsResp.Payments), 1)
} }
p := paymentsResp.Payments[0] p := paymentsResp.Payments[0]
path := p.Htlcs[len(p.Htlcs)-1].Route.Hops
// Ensure that the stored path shows a direct payment to Bob with no // Ensure that the stored path shows a direct payment to Bob with no
// other nodes in-between. // other nodes in-between.
expectedPath := []string{ if len(path) != 1 || path[0].PubKey != net.Bob.PubKeyStr {
net.Bob.PubKeyStr, t.Fatalf("incorrect path")
}
if !reflect.DeepEqual(p.Path, expectedPath) {
t.Fatalf("incorrect path, got %v, want %v",
p.Path, expectedPath)
} }
// The payment amount should also match our previous payment directly. // The payment amount should also match our previous payment directly.
@@ -14317,8 +14314,8 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) {
// We wait for the payment attempt to have been // We wait for the payment attempt to have been
// properly recorded in the DB. // properly recorded in the DB.
if len(payment.Path) == 0 { if len(payment.Htlcs) == 0 {
return fmt.Errorf("path is empty") return fmt.Errorf("no attempt recorded")
} }
delete(payHashes, payment.PaymentHash) delete(payHashes, payment.PaymentHash)