public CLightningInvoiceListener(CLightningClient parent) { if (parent == null) { throw new ArgumentNullException(nameof(parent)); } _Parent = parent; }
public async Task <LightningInvoice> WaitInvoice(CancellationToken cancellation) { using (var cancellation2 = CancellationTokenSource.CreateLinkedTokenSource(cancellation, _Cts.Token)) { var invoice = await _Parent.SendCommandAsync <CLightningInvoice>("waitanyinvoice", new object[] { lastInvoiceIndex }, cancellation : cancellation2.Token); lastInvoiceIndex = invoice.PayIndex.Value; return(CLightningClient.ToLightningInvoice(invoice)); } }