Use library for Payjoin Sender (#2158)

* Use library for Payjoin Sender

* update payjoin sender to use new package and reduce code

* fix using statements
This commit is contained in:
Andrew Camilleri
2021-03-01 14:44:53 +01:00
committed by GitHub
parent c9cfe5cc6e
commit 49ae62b02e
17 changed files with 98 additions and 474 deletions

View File

@@ -9,9 +9,11 @@ using BTCPayServer.HostedServices;
using BTCPayServer.ModelBinders;
using BTCPayServer.Models;
using BTCPayServer.Models.WalletViewModels;
using BTCPayServer.Payments.PayJoin.Sender;
using BTCPayServer.Services;
using Microsoft.AspNetCore.Mvc;
using NBitcoin;
using BTCPayServer.BIP78.Sender;
using NBitcoin.Payment;
using NBXplorer;
using NBXplorer.Models;
@@ -171,7 +173,7 @@ namespace BTCPayServer.Controllers
var cloned = psbt.Clone();
cloned = cloned.Finalize();
await _broadcaster.Schedule(DateTimeOffset.UtcNow + TimeSpan.FromMinutes(2.0), cloned.ExtractTransaction(), btcPayNetwork);
return await _payjoinClient.RequestPayjoin(bip21, derivationSchemeSettings, psbt, cancellationToken);
return await _payjoinClient.RequestPayjoin(bip21, new PayjoinWallet(derivationSchemeSettings), psbt, cancellationToken);
}
[HttpGet]