mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 01:03:03 +02:00
lnrpc+rpcserver: add payment_addr field to PayReq
This commit is contained in:
@@ -4593,6 +4593,12 @@ func (r *rpcServer) DecodePayReq(ctx context.Context,
|
||||
amt = int64(payReq.MilliSat.ToSatoshis())
|
||||
}
|
||||
|
||||
// Extract the payment address from the payment request, if present.
|
||||
var paymentAddr []byte
|
||||
if payReq.PaymentAddr != nil {
|
||||
paymentAddr = payReq.PaymentAddr[:]
|
||||
}
|
||||
|
||||
dest := payReq.Destination.SerializeCompressed()
|
||||
return &lnrpc.PayReq{
|
||||
Destination: hex.EncodeToString(dest),
|
||||
@@ -4605,6 +4611,7 @@ func (r *rpcServer) DecodePayReq(ctx context.Context,
|
||||
Expiry: expiry,
|
||||
CltvExpiry: int64(payReq.MinFinalCLTVExpiry()),
|
||||
RouteHints: routeHints,
|
||||
PaymentAddr: paymentAddr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user