Fix build warning (#5355)

Removes unused `string payoutSource` and shortens return with to ternary operator.
This commit is contained in:
d11n 2023-10-10 05:30:48 +02:00 committed by GitHub
parent e5a2aeb145
commit ef03497350
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,16 +37,9 @@ namespace BTCPayServer.Data
{
var ppBlob = data.PullPaymentData?.GetBlob();
var payoutBlob = data.GetBlob(jsonSerializerSettings);
string payoutSource;
if (payoutBlob.Metadata?.TryGetValue("source", StringComparison.InvariantCultureIgnoreCase,
out var source) is true)
{
return source.Value<string>();
}
else
{
return ppBlob?.Name ?? data.PullPaymentDataId;
}
return payoutBlob.Metadata?.TryGetValue("source", StringComparison.InvariantCultureIgnoreCase, out var source) is true
? source.Value<string>()
: ppBlob?.Name ?? data.PullPaymentDataId;
}
public static PayoutBlob GetBlob(this PayoutData data, BTCPayNetworkJsonSerializerSettings serializers)