make sure entity state gets modified in payout processors

This commit is contained in:
Kukks
2022-08-06 17:05:29 +02:00
parent 680f1470cf
commit 7d454a4c7b
2 changed files with 5 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ using BTCPayServer.PayoutProcessors.Settings;
using BTCPayServer.Services;
using BTCPayServer.Services.Stores;
using LNURL;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using PayoutData = BTCPayServer.Data.PayoutData;
@@ -90,7 +91,7 @@ public class LightningAutomatedPayoutProcessor : BaseAutomatedPayoutProcessor<Au
if (await TrypayBolt(client, blob, payoutData,
lnurlResult.Item1))
{
ctx.Attach(payoutData);
ctx.Attach(payoutData).State = EntityState.Modified;
payoutData.State = PayoutState.Completed;
}
@@ -99,7 +100,7 @@ public class LightningAutomatedPayoutProcessor : BaseAutomatedPayoutProcessor<Au
case BoltInvoiceClaimDestination item1:
if (await TrypayBolt(client, blob, payoutData, item1.PaymentRequest))
{
ctx.Attach(payoutData);
ctx.Attach(payoutData).State = EntityState.Modified;
payoutData.State = PayoutState.Completed;
}

View File

@@ -13,6 +13,7 @@ using BTCPayServer.PayoutProcessors.Settings;
using BTCPayServer.Services;
using BTCPayServer.Services.Stores;
using BTCPayServer.Services.Wallets;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using NBitcoin;
using NBXplorer;
@@ -146,7 +147,7 @@ namespace BTCPayServer.PayoutProcessors.OnChain
var txHash = workingTx.GetHash();
foreach (PayoutData payoutData in transfersProcessing)
{
context.Attach(payoutData);
context.Attach(payoutData).State = EntityState.Modified;
payoutData.State = PayoutState.InProgress;
_bitcoinLikePayoutHandler.SetProofBlob(payoutData,
new PayoutTransactionOnChainBlob()