udpate code to include the value_sat and value_msat fields in payments

This commit is contained in:
Roei Erez 2018-09-16 15:44:11 +03:00
parent c5bebb3b32
commit 6bc01384d6

@ -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()),