mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Use NBitcoin's Network.UriScheme rather than our own (#3005)
This commit is contained in:
@@ -313,10 +313,13 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
var address = string.Empty;
|
||||
try
|
||||
{
|
||||
destination.Destination = destination.Destination.Replace(network.UriScheme+":", "bitcoin:", StringComparison.InvariantCultureIgnoreCase);
|
||||
bip21 = new BitcoinUrlBuilder(destination.Destination, network.NBitcoinNetwork);
|
||||
amount ??= bip21.Amount.GetValue(network);
|
||||
address = bip21.Address.ToString();
|
||||
if (bip21.Address is null)
|
||||
request.AddModelError(transactionRequest => transactionRequest.Destinations[index],
|
||||
"This BIP21 destination is missing a bitcoin address", this);
|
||||
else
|
||||
address = bip21.Address.ToString();
|
||||
if (destination.SubtractFromAmount)
|
||||
{
|
||||
request.AddModelError(transactionRequest => transactionRequest.Destinations[index],
|
||||
|
||||
Reference in New Issue
Block a user