mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-25 00:03:46 +02:00
Merge pull request #3806 from Roasbeef/payreq-msat
lnrpc: add msats to return value of DecodePayReq
This commit is contained in:
commit
1ab3107df4
1116
lnrpc/rpc.pb.go
1116
lnrpc/rpc.pb.go
File diff suppressed because it is too large
Load Diff
@ -2616,6 +2616,7 @@ message PayReq {
|
|||||||
int64 cltv_expiry = 9 [json_name = "cltv_expiry"];
|
int64 cltv_expiry = 9 [json_name = "cltv_expiry"];
|
||||||
repeated RouteHint route_hints = 10 [json_name = "route_hints"];
|
repeated RouteHint route_hints = 10 [json_name = "route_hints"];
|
||||||
bytes payment_addr = 11 [json_name = "payment_addr"];
|
bytes payment_addr = 11 [json_name = "payment_addr"];
|
||||||
|
int64 num_msat = 12 [json_name = "num_msat"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message FeeReportRequest {}
|
message FeeReportRequest {}
|
||||||
|
@ -3252,6 +3252,10 @@
|
|||||||
"payment_addr": {
|
"payment_addr": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "byte"
|
"format": "byte"
|
||||||
|
},
|
||||||
|
"num_msat": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "int64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -4588,9 +4588,10 @@ func (r *rpcServer) DecodePayReq(ctx context.Context,
|
|||||||
// Convert between the `lnrpc` and `routing` types.
|
// Convert between the `lnrpc` and `routing` types.
|
||||||
routeHints := invoicesrpc.CreateRPCRouteHints(payReq.RouteHints)
|
routeHints := invoicesrpc.CreateRPCRouteHints(payReq.RouteHints)
|
||||||
|
|
||||||
amt := int64(0)
|
var amtSat, amtMsat int64
|
||||||
if payReq.MilliSat != nil {
|
if payReq.MilliSat != nil {
|
||||||
amt = int64(payReq.MilliSat.ToSatoshis())
|
amtSat = int64(payReq.MilliSat.ToSatoshis())
|
||||||
|
amtMsat = int64(*payReq.MilliSat)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract the payment address from the payment request, if present.
|
// Extract the payment address from the payment request, if present.
|
||||||
@ -4603,7 +4604,8 @@ func (r *rpcServer) DecodePayReq(ctx context.Context,
|
|||||||
return &lnrpc.PayReq{
|
return &lnrpc.PayReq{
|
||||||
Destination: hex.EncodeToString(dest),
|
Destination: hex.EncodeToString(dest),
|
||||||
PaymentHash: hex.EncodeToString(payReq.PaymentHash[:]),
|
PaymentHash: hex.EncodeToString(payReq.PaymentHash[:]),
|
||||||
NumSatoshis: amt,
|
NumSatoshis: amtSat,
|
||||||
|
NumMsat: amtMsat,
|
||||||
Timestamp: payReq.Timestamp.Unix(),
|
Timestamp: payReq.Timestamp.Unix(),
|
||||||
Description: desc,
|
Description: desc,
|
||||||
DescriptionHash: hex.EncodeToString(descHash[:]),
|
DescriptionHash: hex.EncodeToString(descHash[:]),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user