mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 05:54:26 +01:00
[Greenfield]: Add DescriptionHashOnly to include a description hash in the BOLT11 (#4411)
* [Greenfield]: Add DescriptionHashOnly to include a description hash in the BOLT11 * Add CLN test case * Improve description in Swagger file Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
@@ -565,14 +565,14 @@ namespace BTCPayServer
|
||||
}
|
||||
}
|
||||
|
||||
var descriptionHash = new uint256(Hashes.SHA256(Encoding.UTF8.GetBytes(metadata)), false);
|
||||
LightningInvoice invoice;
|
||||
try
|
||||
{
|
||||
var expiry = i.ExpirationTime.ToUniversalTime() - DateTimeOffset.UtcNow;
|
||||
var param = new CreateInvoiceParams(amount.Value, descriptionHash, expiry)
|
||||
var param = new CreateInvoiceParams(amount.Value, metadata, expiry)
|
||||
{
|
||||
PrivateRouteHints = blob.LightningPrivateRouteHints
|
||||
PrivateRouteHints = blob.LightningPrivateRouteHints,
|
||||
DescriptionHashOnly = true
|
||||
};
|
||||
invoice = await client.CreateInvoice(param);
|
||||
if (!BOLT11PaymentRequest.Parse(invoice.BOLT11, network.NBitcoinNetwork)
|
||||
|
||||
Reference in New Issue
Block a user