Allow specifing fee block target for onchain payout processor (#4065)

Co-authored-by: d11n <mail@dennisreimann.de>
This commit is contained in:
Andrew Camilleri
2022-08-23 12:35:20 +02:00
committed by GitHub
parent 01ab21e4c0
commit 7c8f4c0405
8 changed files with 53 additions and 11 deletions

View File

@@ -52,16 +52,22 @@ namespace BTCPayServer.Controllers.Greenfield
private static OnChainAutomatedPayoutSettings ToModel(PayoutProcessorData data)
{
var blob = BaseAutomatedPayoutProcessor<OnChainAutomatedPayoutBlob>.GetBlob(data);
return new OnChainAutomatedPayoutSettings()
{
FeeBlockTarget = blob.FeeTargetBlock,
PaymentMethod = data.PaymentMethod,
IntervalSeconds = InvoiceRepository.FromBytes<AutomatedPayoutBlob>(data.Blob).Interval
IntervalSeconds = blob.Interval
};
}
private static AutomatedPayoutBlob FromModel(OnChainAutomatedPayoutSettings data)
private static OnChainAutomatedPayoutBlob FromModel(OnChainAutomatedPayoutSettings data)
{
return new AutomatedPayoutBlob() {Interval = data.IntervalSeconds};
return new OnChainAutomatedPayoutBlob()
{
FeeTargetBlock = data.FeeBlockTarget ?? 1,
Interval = data.IntervalSeconds
};
}
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]