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
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
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)
satValue := int64(payment.Info.Value.ToSatoshis())
@ -1153,7 +1147,6 @@ func (r *RouterBackend) MarshallPayment(payment *channeldb.MPPayment) (
ValueSat: satValue,
CreationDate: payment.Info.CreationTime.Unix(),
CreationTimeNs: creationTimeNS,
Path: path,
Fee: int64(route.TotalFees().ToSatoshis()),
FeeSat: int64(route.TotalFees().ToSatoshis()),
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
int64 creation_date = 3 [deprecated = true];
/// The path this payment took.
repeated string path = 4 [deprecated = true];
reserved 4;
/// Deprecated, use fee_sat or fee_msat.
int64 fee = 5 [deprecated = true];

View File

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

View File

@ -4336,15 +4336,12 @@ func testListPayments(net *lntest.NetworkHarness, t *harnessTest) {
len(paymentsResp.Payments), 1)
}
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
// other nodes in-between.
expectedPath := []string{
net.Bob.PubKeyStr,
}
if !reflect.DeepEqual(p.Path, expectedPath) {
t.Fatalf("incorrect path, got %v, want %v",
p.Path, expectedPath)
if len(path) != 1 || path[0].PubKey != net.Bob.PubKeyStr {
t.Fatalf("incorrect path")
}
// 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
// properly recorded in the DB.
if len(payment.Path) == 0 {
return fmt.Errorf("path is empty")
if len(payment.Htlcs) == 0 {
return fmt.Errorf("no attempt recorded")
}
delete(payHashes, payment.PaymentHash)