udpate code to include the value_sat and value_msat fields in payments

This commit is contained in:
Roei Erez committed 2018-09-27 08:58:18 +03:00
1 parent c5bebb3b32
commit 6bc01384d6
1 file changed
+6 -1
+6 -1
View File
@@ -3727,10 +3727,15 @@ func (r *rpcServer) ListPayments(ctx context.Context,
path[i] = hex.EncodeToString(hop[:]) path[i] = hex.EncodeToString(hop[:])
} }
msatValue := int64(payment.Terms.Value)
satValue := int64(payment.Terms.Value.ToSatoshis())
paymentHash := sha256.Sum256(payment.PaymentPreimage[:]) paymentHash := sha256.Sum256(payment.PaymentPreimage[:])
paymentsResp.Payments[i] = &lnrpc.Payment{ paymentsResp.Payments[i] = &lnrpc.Payment{
PaymentHash: hex.EncodeToString(paymentHash[:]), PaymentHash: hex.EncodeToString(paymentHash[:]),
Value: int64(payment.Terms.Value.ToSatoshis()), Value: satValue,
ValueMsat: msatValue,
ValueSat: satValue,
CreationDate: payment.CreationDate.Unix(), CreationDate: payment.CreationDate.Unix(),
Path: path, Path: path,
Fee: int64(payment.Fee.ToSatoshis()), Fee: int64(payment.Fee.ToSatoshis()),