mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 14:44:22 +01:00
lnrpc+rpcserver: populate experimental MPP fields in ListPayment rpc
This commit is contained in:
13
rpcserver.go
13
rpcserver.go
@@ -4379,13 +4379,25 @@ func (r *rpcServer) ListPayments(ctx context.Context,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
htlcs := make([]*lnrpc.HTLCAttempt, 0, len(payment.HTLCs))
|
||||
for _, dbHTLC := range payment.HTLCs {
|
||||
htlc, err := r.routerBackend.MarshalHTLCAttempt(dbHTLC)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
htlcs = append(htlcs, htlc)
|
||||
}
|
||||
|
||||
paymentHash := payment.Info.PaymentHash
|
||||
creationTimeNS := routerrpc.MarshalTimeNano(payment.Info.CreationTime)
|
||||
paymentsResp.Payments = append(paymentsResp.Payments, &lnrpc.Payment{
|
||||
PaymentHash: hex.EncodeToString(paymentHash[:]),
|
||||
Value: satValue,
|
||||
ValueMsat: msatValue,
|
||||
ValueSat: satValue,
|
||||
CreationDate: payment.Info.CreationTime.Unix(),
|
||||
CreationTimeNs: creationTimeNS,
|
||||
Path: path,
|
||||
Fee: int64(route.TotalFees().ToSatoshis()),
|
||||
FeeSat: int64(route.TotalFees().ToSatoshis()),
|
||||
@@ -4393,6 +4405,7 @@ func (r *rpcServer) ListPayments(ctx context.Context,
|
||||
PaymentPreimage: hex.EncodeToString(preimage[:]),
|
||||
PaymentRequest: string(payment.Info.PaymentRequest),
|
||||
Status: status,
|
||||
Htlcs: htlcs,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user