mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-03 17:36:59 +01:00
Prevent null invoice to be added to InvoiceWatcher
This commit is contained in:
parent
9806cab090
commit
62e3f2d8e1
1 changed files with 4 additions and 1 deletions
|
@ -46,6 +46,7 @@ namespace BTCPayServer.Servcices.Invoices
|
||||||
public async Task NotifyReceived(Script scriptPubKey)
|
public async Task NotifyReceived(Script scriptPubKey)
|
||||||
{
|
{
|
||||||
var invoice = await _Wallet.GetInvoiceId(scriptPubKey);
|
var invoice = await _Wallet.GetInvoiceId(scriptPubKey);
|
||||||
|
if(invoice != null)
|
||||||
_WatchRequests.Add(invoice);
|
_WatchRequests.Add(invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,6 +241,8 @@ namespace BTCPayServer.Servcices.Invoices
|
||||||
|
|
||||||
public async Task WatchAsync(string invoiceId, bool singleShot = false)
|
public async Task WatchAsync(string invoiceId, bool singleShot = false)
|
||||||
{
|
{
|
||||||
|
if(invoiceId == null)
|
||||||
|
throw new ArgumentNullException(nameof(invoiceId));
|
||||||
if(!singleShot)
|
if(!singleShot)
|
||||||
await _InvoiceRepository.AddPendingInvoice(invoiceId).ConfigureAwait(false);
|
await _InvoiceRepository.AddPendingInvoice(invoiceId).ConfigureAwait(false);
|
||||||
_WatchRequests.Add(invoiceId);
|
_WatchRequests.Add(invoiceId);
|
||||||
|
|
Loading…
Add table
Reference in a new issue