small changes

This commit is contained in:
Kukks
2020-03-27 14:58:01 +01:00
parent 64717328f6
commit b56d026fdb

View File

@@ -76,7 +76,14 @@ namespace BTCPayServer.Payments.PayJoin
if (psbt != null)
{
transaction = psbt.ExtractTransaction();
try
{
transaction = psbt.ExtractTransaction();
}
catch (Exception e)
{
return UnprocessableEntity("invalid psbt");
}
}
if (transaction.Check() != TransactionCheckResult.Success)
@@ -109,9 +116,9 @@ namespace BTCPayServer.Payments.PayJoin
var invoicePaymentMethod = matchingInvoice.GetPaymentMethod(paymentMethodId);
//get outs to our current invoice address
var currentPaymentMethodDetails =
invoicePaymentMethod.GetPaymentMethodDetails() as BitcoinLikeOnChainPaymentMethod;
(BitcoinLikeOnChainPaymentMethod) invoicePaymentMethod.GetPaymentMethodDetails();
if (!currentPaymentMethodDetails.PayJoin.Enabled)
if (!currentPaymentMethodDetails.PayJoin?.Enabled is true)
{
return UnprocessableEntity($"cannot handle payjoin tx");
}